0

I have a custom protocol that I use for inter-process communication. There are approx. 400-500 messages all with custom payloads. The messages all have a unique message id (word), but that's it. A c struct defines each message.

Almost all messages have custom enums for one or more fields in the struct.

I get message logs that have thousands of these messages and I want to write a decoder that will run relatively fast and not be a complete pain to maintain.

I looked at writing a custom app and storing the decode structure in an ms access db or something. This was very slow and was limited by number of simultaneous decodes. I also looked at xml, but again doing a translation was slow in my small test.

I would love to use something like a wireshark disector, but these aren't network packets... Just a big byte array.

Any thoughts/recommendations would be very appreciated.

1 Answers1

0

If your intent is to look for statistics, then a faster way might just be to add numeric stats in the IPC layer itself. So, when the sender sends an IPC packet of type X, it increases a counter stats_sent_X and a similar book-keeping for the receive side.

On the other hand, if you want to go through the contents of a log, then a simpler approach would be to simply read the log file, split it into tokens, identify the tokens that pertain to the IPC enum-value and then read it.

Manoj Pandey
  • 4,528
  • 1
  • 17
  • 18
  • Thanks for the reply, but I am not looking to get summary stats. I want to decode the payload of the message, but I want to do this as efficiently and quickly as possible. Tokenizing and doing lookups for the matching value to string pairs is rather slow and becomes a maintenance issue with so many messages. That's why I was looking into xml translations or something like that. No luck so far! – user2705726 Aug 23 '13 at 02:57