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

Class for holding/storing various kinds of NetAddr class network addresses. More...

Collaboration diagram for IpPortFrame class:

Functions

FSTATIC gboolean _ipportframe_default_isvalid (const Frame *self, gconstpointer tlvptr,gconstpointer pktend)
 IpPortFrame class 'isvalid' member function - checks address type and length. More...
 
FSTATIC void _ipportframe_setaddr (IpPortFrame *self, guint16 frametype, guint16 port, gconstpointer addr, gsize addrlen)
 
FSTATIC NetAddr_ipportframe_getnetaddr (IpPortFrame *self)
 
FSTATIC void _ipportframe_finalize (AssimObj *obj)
 Finalize an IpPortFrame. More...
 
FSTATIC IpPortFrameipportframe_new (guint16 frame_type,gsize framesize)
 Construct a new IpPortFrame class - allowing for "derived" frame types... More...
 
WINEXPORT IpPortFrameipportframe_ipv4_new (guint16 frame_type, guint16 port, gconstpointer addr)
 Construct and initialize an IPv4 IpPortFrame class. More...
 
WINEXPORT IpPortFrameipportframe_ipv6_new (guint16 frame_type, guint16 port, gconstpointer addr)
 Construct and initialize an IPv6 IpPortFrame class. More...
 
WINEXPORT IpPortFrameipportframe_netaddr_new (guint16 frame_type, NetAddr *addr)
 Construct and initialize an IpPortFrame class from a IP NetAddr class. More...
 
WINEXPORT Frameipportframe_tlvconstructor (gconstpointer tlvstart, gconstpointer pktend, gpointer *ignorednewpkt, gpointer *ignoredpktend)
 Given marshalled packet data corresponding to an IpPortFrame (address), return the corresponding Frame class In other words, un-marshall the data... More...
 
FSTATIC gchar * _ipportframe_toString (gconstpointer aself)
 Convert IPaddrPortFrame object into a printable string. More...
 
typedef struct _IpPortFrame IpPortFrame
 This is our IpPortFrame class object - used for holding NetAddr class network addresses with non-zero port numbers It has some different member functions implementations than its base Frame class - mainly for validating packet contents. More...
 

Detailed Description

Class for holding/storing various kinds of NetAddr class network addresses.

We're a subclass of Frame class.

Typedef Documentation

typedef struct _IpPortFrame IpPortFrame

This is our IpPortFrame class object - used for holding NetAddr class network addresses with non-zero port numbers It has some different member functions implementations than its base Frame class - mainly for validating packet contents.

Definition at line 39 of file ipportframe.h.

Function Documentation

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

IpPortFrame class 'isvalid' member function - checks address type and length.

It only allows IPv4 and IPv6 address types.

Parameters
[in,out]selfIpPortFrame object ('this')
[in]tlvptrPointer to the TLV for this IpPortFrame
[in]pktendPointer to one byte past the end of the packet

Definition at line 75 of file ipportframe.c.

References __FUNCTION__, ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, get_generic_tlv_len(), get_generic_tlv_value(), tlv_get_guint16(), TLVIPV4SIZE, and TLVIPV6SIZE.

Referenced by ipportframe_new(), and ipportframe_tlvconstructor().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _ipportframe_finalize ( AssimObj obj)

Finalize an IpPortFrame.

Definition at line 162 of file ipportframe.c.

References CASTTOCLASS, FREE, and UNREF.

Referenced by ipportframe_new().

Here is the caller graph for this function:

FSTATIC NetAddr * _ipportframe_getnetaddr ( IpPortFrame self)

Definition at line 154 of file ipportframe.c.

Referenced by ipportframe_new().

Here is the caller graph for this function:

FSTATIC void _ipportframe_setaddr ( IpPortFrame self,
guint16  frametype,
guint16  port,
gconstpointer  addr,
gsize  addrlen 
)

Definition at line 125 of file ipportframe.c.

References _IpPortFrame::_addr, _IpPortFrame::baseclass, FREE, _Frame::length, MALLOC, netaddr_new(), _IpPortFrame::port, _NetAddr::setport, tlv_set_guint16(), and _Frame::value.

Referenced by ipportframe_ipv4_new(), ipportframe_ipv6_new(), and ipportframe_tlvconstructor().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC gchar * _ipportframe_toString ( gconstpointer  aself)

Convert IPaddrPortFrame object into a printable string.

Definition at line 308 of file ipportframe.c.

References CASTTOCONSTCLASS.

Referenced by ipportframe_new().

Here is the caller graph for this function:

WINEXPORT IpPortFrame* ipportframe_ipv4_new ( guint16  frame_type,
guint16  port,
gconstpointer  addr 
)

Construct and initialize an IPv4 IpPortFrame class.

Parameters
[in]frame_typeTLV type of the IpPortFrame class (not address type) frame
[in]portport number
[in]addrpointer to the (binary) IPv4 address data

Definition at line 199 of file ipportframe.c.

References _ipportframe_setaddr(), ADDR_FAMILY_IPV4, and ipportframe_new().

Referenced by ipportframe_netaddr_new().

Here is the call graph for this function:

Here is the caller graph for this function:

WINEXPORT IpPortFrame* ipportframe_ipv6_new ( guint16  frame_type,
guint16  port,
gconstpointer  addr 
)

Construct and initialize an IPv6 IpPortFrame class.

Parameters
[in]frame_typeTLV type of the IpPortFrame class (not address type) frame
[in]portport number
[in]addrpointer to the (binary) IPv6 address data

Definition at line 217 of file ipportframe.c.

References _ipportframe_setaddr(), ADDR_FAMILY_IPV6, and ipportframe_new().

Referenced by ipportframe_netaddr_new().

Here is the call graph for this function:

Here is the caller graph for this function:

WINEXPORT IpPortFrame* ipportframe_netaddr_new ( guint16  frame_type,
NetAddr addr 
)

Construct and initialize an IpPortFrame class from a IP NetAddr class.

Definition at line 234 of file ipportframe.c.

References _NetAddr::_addrbody, ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, _NetAddr::addrtype, ipportframe_ipv4_new(), ipportframe_ipv6_new(), and _NetAddr::port.

Referenced by cma.AssimCclasses.pyIpPortFrame::__init__(), create_sendexpecthb(), nano_reqconfig(), and nanoprobe_report_upstream().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC IpPortFrame * ipportframe_new ( guint16  frame_type,
gsize  framesize 
)

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

This can be used directly for creating IpPortFrame class frames, or by derived classes.

Parameters
[in]frame_typeTLV type of the IpPortFrame class (not address type) frame
[in]framesizesize of frame structure (or zero for sizeof(IpPortFrame))

Definition at line 178 of file ipportframe.c.

References _IpPortFrame::_basefinal, _AssimObj::_finalize, _ipportframe_default_isvalid(), _ipportframe_finalize(), _ipportframe_getnetaddr(), _ipportframe_toString(), _IpPortFrame::baseclass, _Frame::baseclass, frame_new(), _IpPortFrame::getnetaddr, _Frame::isvalid, NEWSUBCLASS, and _AssimObj::toString.

Referenced by ipportframe_ipv4_new(), ipportframe_ipv6_new(), and ipportframe_tlvconstructor().

Here is the call graph for this function:

Here is the caller graph for this function:

WINEXPORT Frame* ipportframe_tlvconstructor ( gconstpointer  tlvstart,
gconstpointer  pktend,
gpointer *  ignorednewpkt,
gpointer *  ignoredpktend 
)

Given marshalled packet data corresponding to an IpPortFrame (address), return the corresponding Frame class In other words, un-marshall the data...

Note that this always returns an IpPortFrame class (a subclass of Frame class)

Parameters
[in]tlvstartpointer to start of where to find our TLV
[in]pktendpointer to the first invalid address past tlvstart
ignorednewpkt[ignored] replacement packet if any
ignoredpktend[ignored] end of replaement packet

Definition at line 259 of file ipportframe.c.

References _ipportframe_default_isvalid(), _ipportframe_setaddr(), ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, _IpPortFrame::baseclass, get_generic_tlv_len(), get_generic_tlv_type(), get_generic_tlv_value(), ipportframe_new(), _Frame::length, tlv_get_guint16(), TLVIPV4SIZE, TLVIPV6SIZE, TLVOVERHEAD, and UNREF2.

Here is the call graph for this function: