The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Generic TLV capabilities

Implements a set of client-oriented TLV (Type, Length, Value) capabilities. More...

Functions

guint16 get_generic_tlv_type (gconstpointer tlv_vp, gconstpointer pktend)
 Return the 'Type' of the given TLV TLV entry (first two bytes) More...
 
void set_generic_tlv_type (gpointer tlv_vp, guint16 newtype, gconstpointer pktend)
 Set the 'Type' of the given TLV TLV entry (first two bytes) More...
 
guint32 get_generic_tlv_len (gconstpointer tlv_vp, gconstpointer pktend)
 Return the 'Length' of the given generic TLV entry (first 3 bytes after type) More...
 
void set_generic_tlv_len (gpointer tlv_vp, guint32 newsize, gconstpointer pktend)
 Set the 'Length' of the given generic TLV entry (first 3 bytes after type) More...
 
gconstpointer get_generic_tlv_value (gconstpointer tlv_vp, gconstpointer pktend)
 Return a const pointer to the 'Value' of the given generic TLV entry. More...
 
gpointer get_generic_tlv_nonconst_value (gpointer tlv_vp, gconstpointer pktend)
 Return a non-const (mutable) pointer to the 'Value' of the given generic TLV entry. More...
 
void set_generic_tlv_value (gpointer tlv_vp, void *srcdata, guint32 srcsize, gconstpointer pktend)
 Set the TLV data value to the given 'tlv_vp' pointer. More...
 
gboolean is_valid_generic_tlv_packet (gconstpointer tlv_vp, gconstpointer pktend)
 Return TRUE if this is a valid generic TLV packet. More...
 
gconstpointer get_generic_tlv_first (gconstpointer packet, gconstpointer pktend)
 
gconstpointer get_generic_tlv_next (gconstpointer tlv_vp, gconstpointer pktend)
 Return pointer to the next generic TLV entry after the current location. More...
 
gconstpointer find_next_generic_tlv_type (gconstpointer tlv_vp, guint16 tlvtype, gconstpointer pktend)
 Return pointer to the next TLV entry of the given type at or after the current location. More...
 

Detailed Description

Implements a set of client-oriented TLV (Type, Length, Value) capabilities.

These capabilities are the core of our packet assembly/disassembly infrastructure. Everything we send is wrapped in a Frame class, or a FrameSet class, and those both make extensive use of the capabilties defined here.

Function Documentation

gconstpointer find_next_generic_tlv_type ( gconstpointer  tlv_vp,
guint16  tlvtype,
gconstpointer  pktend 
)

Return pointer to the next TLV entry of the given type at or after the current location.

Parameters
[in]tlv_vpPointer to the current TLV
[in]tlvtypeType of TLV we're looking for
[in]pktendPointer to first byte beyond the packet.

Definition at line 205 of file generic_tlv_min.c.

References GENERICTLV_HDRSZ, get_generic_tlv_next(), and get_generic_tlv_type().

Here is the call graph for this function:

gconstpointer get_generic_tlv_first ( gconstpointer  packet,
gconstpointer  pktend 
)
Parameters
[in]packetPointer to beginning of TLV packet
[in]pktendPointer to first byte after the end of the TLV packet

Definition at line 171 of file generic_tlv_min.c.

References GENERICTLV_HDRSZ, and get_generic_tlv_len().

Referenced by is_valid_generic_tlv_packet().

Here is the call graph for this function:

Here is the caller graph for this function:

gconstpointer get_generic_tlv_next ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)

Return pointer to the next generic TLV entry after the current location.

Parameters
[in]tlv_vpPointer to current TLV entry
[in]pktendPointer to first byte after the end of the TLV packet

Definition at line 185 of file generic_tlv_min.c.

References FRAMETYPE_END, GENERICTLV_HDRSZ, get_generic_tlv_len(), and get_generic_tlv_type().

Referenced by _signframe_compute_cksum_glib(), and find_next_generic_tlv_type().

Here is the call graph for this function:

Here is the caller graph for this function:

gpointer get_generic_tlv_nonconst_value ( gpointer  tlv_vp,
gconstpointer  pktend 
)

Return a non-const (mutable) pointer to the 'Value' of the given generic TLV entry.

Parameters
[in]tlv_vpPointer to beginning of TLV entry,
[in]pktendPointer to one byte past end of packet

Definition at line 90 of file generic_tlv_min.c.

References GENERICTLV_HDRSZ.

Referenced by _compressframe_updatedata(), _cryptcurve25519_updatedata(), _seqnoframe_updatedata(), _signframe_updatedata(), and cryptcurve25519_tlvconstructor().

Here is the caller graph for this function:

guint16 get_generic_tlv_type ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)

Return the 'Type' of the given TLV TLV entry (first two bytes)

Parameters
[in]tlv_vpPointer to beginning of TLV entry
[in]pktendPointer to one byte past end of packet

Definition at line 44 of file generic_tlv_min.c.

References tlv_get_guint16().

Referenced by _decode_packet_framedata_to_frameobject(), _decode_packet_get_frameset_data(), addrframe_tlvconstructor(), compressframe_tlvconstructor(), cryptcurve25519_tlvconstructor(), cstringframe_tlvconstructor(), find_next_generic_tlv_type(), frame_tlvconstructor(), get_generic_tlv_next(), intframe_tlvconstructor(), ipportframe_tlvconstructor(), is_valid_generic_tlv_packet(), nvpairframe_tlvconstructor(), seqnoframe_tlvconstructor(), and unknownframe_tlvconstructor().

Here is the call graph for this function:

Here is the caller graph for this function:

gconstpointer get_generic_tlv_value ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)
gboolean is_valid_generic_tlv_packet ( gconstpointer  tlv_vp,
gconstpointer  pktend 
)

Return TRUE if this is a valid generic TLV packet.

Definition at line 114 of file generic_tlv_min.c.

References DIMOF, FRAMETYPE_END, FRAMETYPE_SIG, GENERICTLV_HDRSZ, get_generic_tlv_first(), get_generic_tlv_len(), get_generic_tlv_type(), and get_generic_tlv_value().

Referenced by _pktdata_to_framesetlist().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_generic_tlv_len ( gpointer  tlv_vp,
guint32  newsize,
gconstpointer  pktend 
)

Set the 'Length' of the given generic TLV entry (first 3 bytes after type)

Parameters
[in]tlv_vpPointer to beginning of TLV entry
[in]newsizeLength to stuff into TLV entry
[in]pktendPointer to one byte past end of packet

Definition at line 70 of file generic_tlv_min.c.

References tlv_set_guint24().

Referenced by _compressframe_updatedata(), _cryptcurve25519_updatedata(), and frameset_construct_packet().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_generic_tlv_type ( gpointer  tlv_vp,
guint16  newtype,
gconstpointer  pktend 
)

Set the 'Type' of the given TLV TLV entry (first two bytes)

Parameters
[in]tlv_vpPointer to beginning of TLV entry
[in]newtypeType to stuff into TLV entry
[in]pktendPointer to one byte past end of packet

Definition at line 52 of file generic_tlv_min.c.

References tlv_set_guint16().

Referenced by _compressframe_updatedata(), _cryptcurve25519_updatedata(), and frameset_construct_packet().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_generic_tlv_value ( gpointer  tlv_vp,
void *  srcdata,
guint32  srcsize,
gconstpointer  pktend 
)

Set the TLV data value to the given 'tlv_vp' pointer.

Precondition
length must have already been set in the TLV
Parameters
tlv_vppointer to TLV entry
srcdatapointer to source data
srcsizesize of source object
[in]pktendPointer to one byte past end of packet

Definition at line 101 of file generic_tlv_min.c.

References GENERICTLV_HDRSZ, and get_generic_tlv_len().

Referenced by _frame_updatedata().

Here is the call graph for this function:

Here is the caller graph for this function: