A P P E N D I X  A

image

Reference Tables

This appendix contains tables that provide valuable information for developers working with packetC. These tables include information concerning:

  • Keywords
  • ASCII table
  • Bits and bytes review
  • The TCP/IP and OSI model network stack
  • Internet and Ethernet header formats

Keywords

The keywords listed within the Reference Tables below are all reserved words within packetC and shall not be redefined by a developer.

Unit Keywords

packet
library
shared
module
main

Declaration Keywords

entry
extern
byte
short
int
long
void
struct
union
bits
pad
enum
typedef
buffer
const
egex
string
reference
descriptor
record
database
db
searchset
set

Pragma Keywords

pragma
control
datatype
export
regex1

Expression Keywords

sizeof
offset
packet_offset
end

Method Keywords

match
find
delete
insert
replicate
requeue

Statement Keywords

at
if
else
while
do
exit
for
goto
return
continue
switch
case
default
break
try
throw
catch
lock
unlock
alert
log
ref
deref

packetC Pre-Defined Keywords

true
false
pib
pkt
sys
$PACKET
$SYS
$PIB
SearchResult
NULL_STOP
NULL_REGEX
ERR_DB_FULL
ERR_DB_READ
ERR_DB_NOMATCH
ERR_LAST_DEFINED
ERR_PKT_INSERT
ERR_PKT_DELETE
ERR_PKT_NOREPLICATE
ERR_SET_NOMATCH
ERR_SET_NOPERFORM
ERR_SET_NOTFOUND
ERR_PKT_NOTREQUEUED

ASCII Table with Decimal to Hexadecimal Conversion

Characters may appear differently in hex editors and packet analysis systems for characters outside of the printable standard alphanumeric sequences.

image

Bits and Bytes

The following section contains quick references regarding the sizes and values of packetC unsigned numbers. In the diagram, MSB is the most significant bit and LSB is the least significant bit in Big-Endian byte-allocation order systems such as packetC. Note that packetC also follows a Little-Endian bit-allocation order.

image

  • 8 Bits per Byte
  • 2 Bytes per Short
  • 2 Shorts per Int
  • 2 Ints per Long


  • Byte     = 8  Bits
  • Short    = 16 Bits
  • Int         = 32 Bits
  • Long     = 64 Bits


  • Byte      Maximum Value 255
  • Short     Maximum Value 65,535
  • Int         Maximum Value 4,294,967,295
  • Long     Maximum Value 18,446,744,073,709,551,615

TCP/IP and OSI Model Network Stack

The OSI model divides layers of the stack into strictly-separated roles and protocols. The TCP/IP model continues with the enveloping of protocols within one another but not necessarily defining their roles in such a strict manner with regard to transport and network layers versus application layers. In packetC, layers follow a physical construction model of representation. If a protocol follows a full Layer 3 IP Header, then that protocol is treated as a Layer 4 protocol whether or not it may be called that in the TCP/IP model. A simple reference view of this schema is shown below.

image

Header Formats

The following network protocols are provided for reference and have supporting descriptors defined in protocols.ph (see Chapter 25 for Standard Networking Descriptors). The following diagrams call out byte and bit positions matching the packetC big-endian byte order and little-endian bit order representation of packet fields when accessed directly or via descriptors.

Basic Ethernet II Header Format

image

image

Ethernet Header with VLAN Tag (802.1Q) Format

image

image

Ethernet Header with Stacked VLAN Tags (802.1Q in Q) Format

image

image

IPv4 Header

image

image

IPv6 Header

image

image

TCP Header

image

image

UDP Header

image

ICMP Header

image

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.200.109