Rawsock library  v0.3.4
Library to make the use of raw sockets easier, under Linux. Currently supporting IPv4, UDP and a custom latency measurement protocol (LaMP - supported both in raw and non-raw sockets).
lamphdr Struct Reference

Main LaMP packet header structure. More...

#include <rawsock_lamp.h>

Data Fields

uint8_t reserved
 
uint8_t ctrl
 
uint16_t id
 
uint16_t seq
 
uint16_t len
 
uint64_t sec
 
uint64_t usec
 

Detailed Description

Main LaMP packet header structure.

This structure is the main LaMP packet header structure, to be used to prepare and read any LaMP packet.

It contains all the required fields, and it can be used like other Linux structures, such as struct ether_header, struct iphdr, struct udphdr and so on.

An application dealing with LaMP packets should declare at least once a struct lamphdr.

Definition at line 147 of file rawsock_lamp.h.

Field Documentation

uint8_t ctrl

Control field, 1 B: the first 4 bits should always be set to 0xA, while the second 4 bits are used to encode the packet type.

Definition at line 149 of file rawsock_lamp.h.

uint16_t id

Identification field, 2 B: it is used to identify a certain LaMP session.

Definition at line 150 of file rawsock_lamp.h.

uint16_t len

Payload length or packet type, 2 B: it store the (optional) payload length, up to 65535 B, or, if the message type is INIT or FOLLOWUP, the type of the connection that should be established (pinglike or unidirectional) or the kind of follow-up message.

Definition at line 152 of file rawsock_lamp.h.

uint8_t reserved

Reserved field, 1 B: should always be set to 0xAA.

Definition at line 148 of file rawsock_lamp.h.

uint64_t sec

64-bit seconds timestamp, 8 B: it stores the seconds of the current packet timestamp.

Definition at line 153 of file rawsock_lamp.h.

uint16_t seq

Sequence field, 2 B: it is used to store cyclically increasing sequence numbers, up to 65535, that can be used to identify lost packets and to associate replies with requests.

Definition at line 151 of file rawsock_lamp.h.

uint64_t usec

64-bit microseconds timestamp, 8 B: it stores the microseconds of the current packet timestamp.

Definition at line 154 of file rawsock_lamp.h.


The documentation for this struct was generated from the following file: