Results 1 to 9 of 9

Thread: Packet Logging Patch coming soon

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    183

    Packet Logging Patch coming soon

    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.

  2. #2
    Developer Ratt's Avatar
    Join Date
    Dec 2001
    Posts
    533
    Excellent! I look forward to seeing it.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    183
    OMG what did I volunteer to do.

    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

    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.

  4. #4
    Registered User
    Join Date
    Dec 2001
    Posts
    183
    /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.

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    247
    Sorry about that. Looking forward to your patch.

    fee

  6. #6
    Registered User
    Join Date
    Dec 2001
    Posts
    183
    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

  7. #7
    Registered User
    Join Date
    Dec 2001
    Posts
    183
    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.

  8. #8
    Registered User
    Join Date
    Dec 2001
    Posts
    247
    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

  9. #9
    Registered User
    Join Date
    Dec 2001
    Posts
    183
    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 ).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

You may post new threads
You may post replies
You may post attachments
You may edit your posts
HTML code is Off
vB code is On
Smilies are On
[IMG] code is On