The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Frame class

Class for holding/storing binary blobs - Base class for all the other Frame types. More...

Collaboration diagram for Frame class:

Modules

 AddrFrame class
 Class for holding/storing various kinds of NetAddr class network addresses.
 
 CompressFrame class
 Class implementing Compression/decompression on the wire.
 
 CryptFrame class
 Class for encrypting FrameSets.
 
 CstringFrame class
 Class for holding/storing C-style null-terminated strings - Subclass of Frame class.
 
 IntFrame class
 Class representing various length of integers - subclass of Frame class.
 
 IpPortFrame class
 Class for holding/storing various kinds of NetAddr class network addresses.
 
 NVpairFrame class
 Class for holding/storing pairs of strings as name/value pairs Subclass of Frame class.
 
 SeqnoFrame class
 Class representing packet "sequence numbers" - subclass of Frame class.
 
 SignFrame class
 Class representing digital signatures - subclass of Frame class.
 
 UnknownFrame class
 Class representing an unrecogized or unknown type of frame in a packet - subclass of Frame class.
 

Data Structures

struct  _Frame
 This is the base Frame class object (in-memory TLV (type, length, value)) for every general component of a packet. More...
 

Functions

FSTATIC void _frame_default_finalize (AssimObj *obj)
 Finalize a Frame. More...
 
FSTATIC void frame_default_valuefinalize (gpointer value)
 Finalize a Frame. More...
 
FSTATIC gsize _frame_dataspace (const Frame *f)
 Return total space required to put this frame in a packet (marshalled size) More...
 
FSTATIC gboolean _frame_default_isvalid (const Frame *self,gconstpointer tlvptr,gconstpointer pktend)
 Default Frame class 'isvalid' member function (always returns TRUE) More...
 
FSTATIC void _frame_setvalue (Frame *self,gpointer value,guint16 length,GDestroyNotify valnotify)
 'setvalue' Frame class member function. More...
 
FSTATIC void _frame_updatedata (Frame *self,gpointer tlvptr,gconstpointer pktend,FrameSet *fs)
 Update packet data ('updatedata') Frame class member function. More...
 
Frameframe_new (guint16 frame_type, gsize framesize)
 Construct a new frame - allowing for "derived" frame types... More...
 
Frameframe_tlvconstructor (gconstpointer tlvstart, gconstpointer pktend, gpointer *ignorednewpkt, gpointer *ignoredpktend)
 Given marshalled data corresponding to a Frame (basic binary frame), return that corresponding Frame In other words, un-marshall the data... More...
 
FSTATIC void _frame_dump (const Frame *f,const char *prefix)
 Basic "dump a frame" member function - we use g_debug() for output. More...
 

Detailed Description

Class for holding/storing binary blobs - Base class for all the other Frame types.

Function Documentation

FSTATIC gsize _frame_dataspace ( const Frame f)

Return total space required to put this frame in a packet (marshalled size)

Parameters
fFrame to return the marshalled size of

Definition at line 65 of file frame.c.

References FRAME_INITSIZE, and _Frame::length.

Referenced by frame_new().

Here is the caller graph for this function:

FSTATIC void _frame_default_finalize ( AssimObj obj)

Finalize a Frame.

Parameters
objFrame to finalize

Definition at line 43 of file frame.c.

References __FUNCTION__, _assimobj_finalize(), CASTTOCLASS, and DEBUGMSG5.

Referenced by frame_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC gboolean _frame_default_isvalid ( const Frame self,
gconstpointer  tlvptr,
gconstpointer  pktend 
)

Default Frame class 'isvalid' member function (always returns TRUE)

Parameters
selfFrame object ('this')
tlvptrPointer to the TLV for this Frame
pktendPointer to one byte past the end of the packet

Definition at line 73 of file frame.c.

Referenced by frame_new().

Here is the caller graph for this function:

void _frame_dump ( const Frame f,
const char *  prefix 
)

Basic "dump a frame" member function - we use g_debug() for output.

It would be nice for derived classes to override this as appropriate.

Parameters
[in]fFrame being dumped
[in]prefixPrefix to put out before each line when dumping it

Definition at line 164 of file frame.c.

References _Frame::dataspace, _Frame::length, proj_class_classname(), and _Frame::type.

Referenced by frame_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _frame_setvalue ( Frame self,
gpointer  value,
guint16  length,
GDestroyNotify  valnotify 
)

'setvalue' Frame class member function.

Parameters
selfFrame object ('this')
valueValue to save away
lengthLength of value
valnotifyValue destructor.

Definition at line 85 of file frame.c.

Referenced by frame_new().

Here is the caller graph for this function:

FSTATIC void _frame_updatedata ( Frame self,
gpointer  tlvptr,
gconstpointer  pktend,
FrameSet fs 
)

Update packet data ('updatedata') Frame class member function.

Parameters
selfFrame object ('this')
tlvptrWhere the Frame TLV is
pktendEnd of packet
fsFrameSet to update (or not)

Definition at line 100 of file frame.c.

References set_generic_tlv_value().

Referenced by frame_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void frame_default_valuefinalize ( gpointer  value)

Finalize a Frame.

Parameters
valueValue to finalize

Definition at line 55 of file frame.c.

References __FUNCTION__, DEBUGMSG4, and FREE.

Referenced by _jsondiscovery_send(), create_setconfig(), cstringframe_tlvconstructor(), frame_tlvconstructor(), nano_reqconfig(), nanoprobe_report_upstream(), nvpairframe_tlvconstructor(), and unknownframe_tlvconstructor().

Here is the caller graph for this function:

Frame* frame_new ( guint16  frame_type,
gsize  framesize 
)

Construct a new frame - allowing for "derived" frame types...

This can be used directly for creating basic binary frames, or by derived classes.

Parameters
frame_typeTLV type of Frame
framesizesize of frame structure (or zero for sizeof(Frame))

Definition at line 113 of file frame.c.

References __FUNCTION__, _AssimObj::_finalize, _frame_dataspace(), _frame_default_finalize(), _frame_default_isvalid(), _frame_dump(), _frame_setvalue(), _frame_updatedata(), assimobj_new(), BINDDEBUG, _Frame::dataspace, DEBUGMSG5, _Frame::dump, _Frame::isvalid, _Frame::length, NEWSUBCLASS, _Frame::setvalue, _Frame::type, _Frame::updatedata, _Frame::value, and _Frame::valuefinalize.

Referenced by cma.AssimCclasses.pyFrame::__init__(), addrframe_new(), cast_frameset_tests(), compressframe_new(), construct_pcap_frameset(), cryptframe_new(), cstringframe_new(), frame_tlvconstructor(), frameset_construct_packet(), intframe_new(), ipportframe_new(), nvpairframe_new(), seqnoframe_new(), signframe_new(), and unknownframe_new().

Here is the call graph for this function:

Here is the caller graph for this function:

Frame* frame_tlvconstructor ( gconstpointer  tlvstart,
gconstpointer  pktend,
gpointer *  ignorednewpkt,
gpointer *  ignoredpktend 
)

Given marshalled data corresponding to a Frame (basic binary frame), return that corresponding Frame In other words, un-marshall the data...

Parameters
[in]tlvstartstart of TLV for this Frame
[in]pktendfirst invalid byte past 'tlvstart'
ignorednewpkt[ignored] replacement packet
ignoredpktend[ignored] end of replacement packet

Definition at line 145 of file frame.c.

References frame_default_valuefinalize(), frame_new(), get_generic_tlv_len(), get_generic_tlv_type(), get_generic_tlv_value(), _Frame::length, and _Frame::setvalue.

Here is the call graph for this function: