Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dumpAvroRecords method and start method error checking #9

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

nick-ls
Copy link
Contributor

@nick-ls nick-ls commented Sep 7, 2022

The dumpAvroRecords method is nearly a clone of the perAvroRecord method except for the fact that it's a generator function instead of one that uses callbacks. This makes it easier to iterate over all records in an avro file using something like a for in loop rather than an asynchronous callback. Basic checking for whether the start method was called yet is also something that is implemented.

salcock and others added 30 commits April 20, 2021 15:50
Add support for reading flowtuple4 files
Incomplete, but most of the way there.
 * explicitly declare certain variables as unsigned and const
 * use boundscheck and wraparound decorators to try and reduce
   wasteful index checking on our bytearrays
 * use cdef for internal functions to save python overhead
 * explicitly declare certain variables as unsigned and const
 * use boundscheck and wraparound decorators to try and reduce
   wasteful index checking on our bytearrays
 * use cdef for internal functions to save python overhead
 * avoid passing parsedString struct into functions, as the
   scope change can completely break the contents if intentional
   null bytes are present
 * change parseString to allocate memory for string contents
   directly and copy the string into it
 * null characters are appending to the end of the string in
   read_string() itself
 * added parameter to read_string() to force null termination to
   NOT be added to the read string
 * ensure entire initial packet contents are returned by
   getRsdosPacketString(), not just up to the first null byte
Code to support 'rb' (or non-utf8 decoding of 'r' files) is
not yet available in pywandio publicly, which was causing
issues for external users.
Add code to support reading RS-DOS attack avro data
All AvroReaders will now save the schema from the Avro header
so that they can check for the presence of potentially missing
data fields.
Also added a getRsdosPacketSize() method that accounts for any
tag header that may be present.
Add support for upcoming new RSDOS data schema
 * Don't include fields in the string that don't exist in schema
   version 1.
 * Decode string fields to 'utf-8' before adding to str() result.
 * Rename 'attacker_ip_count' to 'attacker_slash16_count' for v2
   asDict() result.
Update rsdos parser to handle both the original schema and the new version just added to corsaro3
Schema version is now declared in the baseavro class, as it
is used by multiple data formats.
Now the perAvroRecord and dumpAvroRecords commands check to make sure that the reader has had the start method called on it before attempting to process any files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants