![Texas TMS320C6000 Programmer'S Reference Manual Download Page 140](http://html.mh-extra.com/html/texas/tms320c6000/tms320c6000_programmers-reference-manual_1093844140.webp)
Packet (Pkt) Object
A-6
A.3 Packet (Pkt) Object
A.3.1 Synopsis
In order to fit nicely into an object oriented environment, network packets are
abstracted into two data objects, packets and packet fragments.
The packet object (PKT) is comprised of information about the packet charac-
teristics, like the ingress and egress device, the route associated with the
packet, the size and state of various protocol headers, etc. The packet frag-
ment object (FRAG) abstracts the actual packet data and information about
data buffer containing the packet.
The figure below illustrates the relationship between packets, fragments, and
the various buffer pools from which fragment data buffers can be allocated.
This section deals with the packet object, and the following section describes
the frag object and buffer pools.
Figure A–1. Packet and Packet Fragment Objects
Buffer Pool
PACKET OBJECT
Flags
TX / RX Device
Ether Type
Destination Address
Route
Size L2 Mac Header
Size Protocol Header
Size Transport Header
Frag Object Handle
FRAG OBJECT
Buffer Pool ID
Buffer Pointer
Buffer Size
Valid Size
Offset to Valid
Frag Object
Buffer
L2 Mac Header
IP Header
Transport
Header
Payload
Free Buffers
The packet object is the container used for all packet data. The entire Ethernet
packet (MAC header, IP header and Options, Transport header, and payload)
is contained in the packet object. As each successive network layer builds or
decodes that packet, the information contained in the packet object becomes
more and more specific. The packet object flags is the best place to start when
determining packet status.
// Packet Flags
#define FLG_PKT_LLC_VALID 0x0001 // LLC Packet Header is present
#define FLG_PKT_IP_VALID 0x0002 // IP Pkt Header is present
#define FLG_PKT_NET_VALID 0x0004 // Network/Transport Header present
#define FLG_PKT_MACBCAST 0x0008 // Pkt Received as a LL BCast
#define FLG_PKT_MACMCAST 0x0010 // Pkt Received as a LL MCast
When a particular layer header is marked as valid or “present”, it means that
the header is incorporated into the “valid” portion of the packet fragment (see