Skip to content

britram/ripfix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ripfix

IPFIX implementation for Ruby

Provides a bridge between records in IPFIX Messages and Ruby hashes. Intended as a reference implementation

To write Messages

  1. create a Model (model = InfoModel.new.load_default)

  2. create a Session (session = Session.new(m))

  3. create a Message within the Session (message = Message.new(nil, session, domain))

  4. create Templates and append Information Elements via the << operator

  5. append Templates to the Message via the << operator

  6. append Hashes to the Message via the << operator

  7. Get the encoded message using message.string(), or write it to an IO using message.write()

To read Messages

  1. create a Model (model = InfoModel.new.load_default)

  2. create a Session (session = Session.new(m))

  3. create a Message within the Session from the encoded string containing the Message (message = Message.new(string, session)), or create an empty Message (message = Message.new(nil, session)) and fill it in from an IO (Message.read(io))

  4. Iterate over hashes in the message using Message.each().

See the tests for code examples.

About

IPFIX implementation for Ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published