PDA

View Full Version : Packet Logging Patch coming soon



Yendor
01-08-2002, 08:37 AM
Just to let any developers know...

As per Ratt's suggestion that I pursue this I am completeing a first pass of some new perl friendly packet logging (configurable per opcode). As part of this I am making a fair number of cosmetic changes to everquest.h/opcode.h/packet.cpp. These changes normalize the naming style of opcodes, structures, spelling errors, etc.

Just letting you know that it's coming. I can submit about anytime, but it's still being tweaked and I am still adding pretty printers for more opcodes. There will be one very large file added (logger.cpp and logger.h), hopefully I will do an optimization pass at it later...

Anyway I am quite pleased with the result. One other change I am thinking of allowing is an option to log each opcode to a seperate file rather than all to the same file.

Ratt
01-08-2002, 09:42 AM
Excellent! I look forward to seeing it.

Yendor
01-09-2002, 07:44 PM
OMG what did I volunteer to do. :eek:

That took a bit longer than I thought, but I have pretty printers for all 67 or so opcodes.

Log file generated is:
(1 line per opcode, makes for some long lines, but the point is to be friendly to log processing scripts and such... also looks good piped through less with word wrap turned off).

<tag> <timestamp> <length> <direction> <opcode> <data...>

tag = (R=known opcode, U=unknown opcode)
timestamp = time in seconds from unix epoch
length = length of data packet
direction = direction packet was going in (1=to server,2=to client)
opcode = 4 character hexcode of opcode

data = pretty printed contents of packet with unknown values,
printed out has hex strings

opcodes are individually selected for logging via the conf file,
but its not a use-friendly form of specifying them. A 96-bit
bit mask expressed as a hex string. Lovely I know, I might work on something more friendly later.

If you have any suggestions let me know.

Going to do some testing and double check the pretty printer against the structures again to make sure I didn't miss anything. But I should be posting my first patch tomorrow I hope. This will be followed by an additional patch of cosmetic code changes to have the rest of showeq match some of the new naming scheme (just making it be consistent, 70% of the opcode structures used the same naming scheme, just cleaning up the rest).

But I wanted to post the guts of the patch without all the little cosmetic changes seperate so the CVS team has an easier time seeing what is changed. (I put in backward compatibility names into everquest.h so the rest of showeq doesn't have to be changed for the new logging stuff to be put in).

In summary the changes are in:

packet.cpp is patched to call packet logging functions for each opcode when in zoneDispatch, that entire function has been reformatted as well... gotta have my stuff lined up or my eyes hurt :p

logger.cpp is added (1700+ lines)

logger.h is added

main.cpp is patched to handle some new .conf file options

decode.cpp is slightly patched to handle a couple renamed ops

everquest.h is patched with new structure names, fixed datatypes in structures, spelling corrections, etc

Again will try to get this posted on Thursday or Friday.

Yendor
01-10-2002, 12:27 PM
/trout fee

Grrr.. last CVS commit will cause some delays in my logging patch as I will probably have to manually merge in those changes.

fee
01-10-2002, 01:42 PM
Sorry about that. Looking forward to your patch.

fee

Yendor
01-10-2002, 02:21 PM
Actually it wasn't too bad, already merged the changes.

Yeah I hope the logging will help find some more useful data in the structures maybe. Still pondering one more change, and that is logging the structure size as well as the packet size to help take note when the two don't match. Means going backing and modifying 68 or so packet logging functions, not something I am actually dying to do. But I was interested in verifying all the packet sizes...

/untrout fee

Yendor
01-10-2002, 06:44 PM
The new packet logging patch is now posted.

Feel free to ask any questions. It has not been extensively tested, gone over it by eye many times, but have not checked that all the opcode pretty printers are formatting things exactly right (may have missed a space between fields here and there, or forgotten a newline, etc). But its more than enough to get going.

It should have very close to ZERO impact on showeq if the user hasn't turned on the new packet logging options in the conf file.

Hope it helps other developers.

fee
01-14-2002, 12:41 AM
Yendor

I have reviewed your code fairly extensivly. Looks like a great start, mad props on all that work. I have a couple problems with some of your changes and at this time I am going to label your patch as pending untill we can work out the issues.

I would like to chat with you on the IRC channel about this at some point to discuss these issues. This is by no means a rejection of your code, I do think its a good addition and will be very useful in the near future.

fee

Yendor
01-14-2002, 08:27 PM
fee,

I completed the changes you request and posted new patch files in the patch area. If the changes are insufficient I will modify further (or argue why they were needed :)).