NewMadeleine

Documentation

nm_headers.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nm_header_global_s
 global header at the beginning of pw More...
 
struct  nm_header_pkt_data_s
 
struct  nm_header_pkt_data_chunk_s
 sub-header for pkt_data chunks More...
 
struct  nm_header_data_s
 
struct  nm_header_short_data_s
 header for very short data; single chunk assumed (chunk_offset=0, chunk_len=len, FLAG_LASTCHUNK) More...
 
struct  nm_header_msg_s
 header for msg matching information only, contains no data; for cases where early information is needed (partitioned) More...
 
struct  nm_header_ctrl_rdv_s
 
struct  nm_header_ctrl_rtr_s
 
struct  nm_header_ctrl_ack_s
 
struct  nm_header_common_s
 base header that matches all data/ctrl headers first fields (except header_strat) More...
 
union  nm_header_ctrl_generic_s
 a unified control header type
More...
 
union  nm_header_data_generic_s
 a unified data header type More...
 
union  nm_header_generic_s
 a unified header for all types (ctrl/data) More...
 
struct  nm_header_strat_s
 header for strategy private packets More...
 
struct  nm_header_debug_s
 header for debug messages More...
 
struct  nm_ctrl_chunk_s
 a chunk of control data More...
 

Macros

#define NM_PROTO_ID_MASK   0x0F
 mask for proto ID part More...
 
#define NM_PROTO_FLAG_MASK   0xF0
 mask for proto flags More...
 
#define NM_PROTO_SMALL_DATA   0x01
 a chunk of data on small trk More...
 
#define NM_PROTO_SHORT_DATA   0x02
 a simplified (short header) chunk of data More...
 
#define NM_PROTO_PKT_DATA   0x03
 new optimized packet format More...
 
#define NM_PROTO_RDV   0x04
 rendez-vous request More...
 
#define NM_PROTO_RTR   0x05
 ready-to-receive, replay to rdv More...
 
#define NM_PROTO_ACK   0x06
 an ack for a ssend (sent when receiving first chunk) More...
 
#define NM_PROTO_STRAT   0x07
 ctrl chunk for strategy (don't decode in nm core) More...
 
#define NM_PROTO_MSG   0x08
 msg matching informations, contains no data chunk More...
 
#define NM_PROTO_DEBUG   0x0F
 internal debug msg More...
 
#define NM_PROTO_FLAG_LASTCHUNK   0x10
 last chunk of data for the given pack More...
 
#define NM_PROTO_FLAG_ALIGNED   0x20
 data is 32 bit-aligned in packet More...
 
#define NM_PROTO_FLAG_ACKREQ   0x40
 data sent as synchronous send- please send an ack on first chunk More...
 
#define NM_HEADER_PKT_DATA_SIZE    sizeof(struct nm_header_pkt_data_s)
 
#define NM_HEADER_DATA_SIZE    nm_aligned(sizeof(struct nm_header_data_s))
 
#define NM_HEADER_SHORT_DATA_SIZE    nm_aligned(sizeof(struct nm_header_short_data_s))
 
#define NM_HEADER_CTRL_SIZE(P_CTRL)    nm_header_ctrl_size(P_CTRL)
 

Typedefs

typedef union nm_header_ctrl_generic_s nm_header_ctrl_generic_t
 
typedef union nm_header_data_generic_s nm_header_data_generic_t
 

Functions

struct nm_header_global_s __attribute__ ((packed))
 
static void nm_header_global_finalize (struct nm_pkt_wrap_s *p_pw)
 
static uint16_t nm_header_global_v0len (const struct nm_pkt_wrap_s *p_pw)
 
 PUK_LIST_DECLARE_TYPE (nm_ctrl_chunk)
 
 PUK_LIST_CREATE_FUNCS (nm_ctrl_chunk)
 
 NM_ALLOCATOR_TYPE (nm_ctrl_chunk, struct nm_ctrl_chunk_s)
 allocator for control chunks More...
 
static size_t nm_header_ctrl_size (const union nm_header_ctrl_generic_s *const p_ctrl)
 
static void nm_header_init_pkt_data (struct nm_header_pkt_data_s *p_header, nm_core_tag_t tag_id, nm_seq_t seq, uint8_t flags, nm_len_t len, nm_len_t chunk_offset)
 
static void nm_header_init_data (struct nm_header_data_s *p_header, nm_core_tag_t tag_id, nm_seq_t seq, uint8_t flags, uint16_t skip, nm_len_t len, nm_len_t chunk_offset)
 
static void nm_header_init_short_data (struct nm_header_short_data_s *p_header, nm_core_tag_t tag_id, nm_seq_t seq, nm_len_t len)
 
static void nm_header_init_msg (union nm_header_ctrl_generic_s *p_ctrl, nm_core_tag_t tag_id, nm_seq_t seq, nm_len_t msg_len)
 
static void nm_header_init_rdv (union nm_header_ctrl_generic_s *p_ctrl, struct nm_req_s *p_pack, nm_len_t chunk_len, nm_len_t chunk_offset, uint8_t rdv_flags)
 
static void nm_header_init_rtr (union nm_header_ctrl_generic_s *p_ctrl, nm_core_tag_t tag, nm_seq_t seq, nm_trk_id_t trk_id, nm_len_t chunk_offset, nm_len_t chunk_len, const void *p_rdv_data)
 
static void nm_header_init_ack (union nm_header_ctrl_generic_s *p_ctrl, nm_core_tag_t tag, nm_seq_t seq)
 
static void nm_header_init_debug (struct nm_header_debug_s *p_header, int req)
 

Variables

uint16_t v0len
 size of v0 actually used ( == offset value to reach v[1] ) More...
 
nm_proto_t proto_id
 proto ID- should be NM_PROTO_PKT_DATA More...
 
nm_core_tag_t tag_id
 tag for the message More...
 
nm_seq_t seq
 sequence number More...
 
nm_len_t data_len
 length of data enclosed More...
 
nm_len_t chunk_offset
 offset of the enclosed chunk More...
 
uint16_t hlen
 length in header (header + data in header) More...
 
uint16_t len
 chunk len More...
 
uint16_t skip
 skip value for iovec More...
 
nm_len_t msg_len
 length of the full message More...
 
nm_len_t chunk_len
 length of this chunk More...
 
nm_prio_t priority
 
nm_trk_id_t trk_id
 index of the track relative to the gate More...
 
char rdv_data [NM_HEADER_RTR_DATA_SIZE]
 
union nm_header_ctrl_generic_s __attribute__
 
uint64_t req
 a type of debug request; unused for now More...
 

Macro Definition Documentation

◆ NM_HEADER_CTRL_SIZE

#define NM_HEADER_CTRL_SIZE (   P_CTRL)     nm_header_ctrl_size(P_CTRL)

Definition at line 229 of file nm_headers.h.

◆ NM_HEADER_DATA_SIZE

#define NM_HEADER_DATA_SIZE    nm_aligned(sizeof(struct nm_header_data_s))

Definition at line 223 of file nm_headers.h.

◆ NM_HEADER_PKT_DATA_SIZE

#define NM_HEADER_PKT_DATA_SIZE    sizeof(struct nm_header_pkt_data_s)

Definition at line 220 of file nm_headers.h.

◆ NM_HEADER_SHORT_DATA_SIZE

#define NM_HEADER_SHORT_DATA_SIZE    nm_aligned(sizeof(struct nm_header_short_data_s))

Definition at line 226 of file nm_headers.h.

◆ NM_PROTO_ACK

#define NM_PROTO_ACK   0x06

an ack for a ssend (sent when receiving first chunk)

Definition at line 57 of file nm_headers.h.

◆ NM_PROTO_DEBUG

#define NM_PROTO_DEBUG   0x0F

internal debug msg

Definition at line 63 of file nm_headers.h.

◆ NM_PROTO_FLAG_ACKREQ

#define NM_PROTO_FLAG_ACKREQ   0x40

data sent as synchronous send- please send an ack on first chunk

Definition at line 70 of file nm_headers.h.

◆ NM_PROTO_FLAG_ALIGNED

#define NM_PROTO_FLAG_ALIGNED   0x20

data is 32 bit-aligned in packet

Definition at line 68 of file nm_headers.h.

◆ NM_PROTO_FLAG_LASTCHUNK

#define NM_PROTO_FLAG_LASTCHUNK   0x10

last chunk of data for the given pack

Definition at line 66 of file nm_headers.h.

◆ NM_PROTO_FLAG_MASK

#define NM_PROTO_FLAG_MASK   0xF0

mask for proto flags

Definition at line 44 of file nm_headers.h.

◆ NM_PROTO_ID_MASK

#define NM_PROTO_ID_MASK   0x0F

mask for proto ID part

Definition at line 42 of file nm_headers.h.

◆ NM_PROTO_MSG

#define NM_PROTO_MSG   0x08

msg matching informations, contains no data chunk

Definition at line 61 of file nm_headers.h.

◆ NM_PROTO_PKT_DATA

#define NM_PROTO_PKT_DATA   0x03

new optimized packet format

Definition at line 51 of file nm_headers.h.

◆ NM_PROTO_RDV

#define NM_PROTO_RDV   0x04

rendez-vous request

Definition at line 53 of file nm_headers.h.

◆ NM_PROTO_RTR

#define NM_PROTO_RTR   0x05

ready-to-receive, replay to rdv

Definition at line 55 of file nm_headers.h.

◆ NM_PROTO_SHORT_DATA

#define NM_PROTO_SHORT_DATA   0x02

a simplified (short header) chunk of data

Definition at line 49 of file nm_headers.h.

◆ NM_PROTO_SMALL_DATA

#define NM_PROTO_SMALL_DATA   0x01

a chunk of data on small trk

Definition at line 47 of file nm_headers.h.

◆ NM_PROTO_STRAT

#define NM_PROTO_STRAT   0x07

ctrl chunk for strategy (don't decode in nm core)

Definition at line 59 of file nm_headers.h.

Typedef Documentation

◆ nm_header_ctrl_generic_t

Definition at line 202 of file nm_headers.h.

◆ nm_header_data_generic_t

Definition at line 203 of file nm_headers.h.

Function Documentation

◆ __attribute__()

struct nm_header_global_s __attribute__ ( (packed)  )

◆ NM_ALLOCATOR_TYPE()

NM_ALLOCATOR_TYPE ( nm_ctrl_chunk  ,
struct nm_ctrl_chunk_s   
)

allocator for control chunks

◆ nm_header_ctrl_size()

static size_t nm_header_ctrl_size ( const union nm_header_ctrl_generic_s *const  p_ctrl)
inlinestatic

◆ nm_header_global_finalize()

static void nm_header_global_finalize ( struct nm_pkt_wrap_s p_pw)
inlinestatic

Definition at line 25 of file nm_headers.h.

References h, NM_TRK_SMALL, nm_pkt_wrap_s::trk_id, nm_pkt_wrap_s::v, and v0len.

◆ nm_header_global_v0len()

static uint16_t nm_header_global_v0len ( const struct nm_pkt_wrap_s p_pw)
inlinestatic

◆ nm_header_init_ack()

static void nm_header_init_ack ( union nm_header_ctrl_generic_s p_ctrl,
nm_core_tag_t  tag,
nm_seq_t  seq 
)
inlinestatic

Definition at line 326 of file nm_headers.h.

References nm_header_ctrl_generic_s::ack, NM_PROTO_ACK, nm_header_ctrl_ack_s::proto_id, seq, nm_header_ctrl_ack_s::seq, tag, and nm_header_ctrl_ack_s::tag_id.

Referenced by nm_core_post_ack().

Here is the caller graph for this function:

◆ nm_header_init_data()

static void nm_header_init_data ( struct nm_header_data_s p_header,
nm_core_tag_t  tag_id,
nm_seq_t  seq,
uint8_t  flags,
uint16_t  skip,
nm_len_t  len,
nm_len_t  chunk_offset 
)
inlinestatic

◆ nm_header_init_debug()

static void nm_header_init_debug ( struct nm_header_debug_s p_header,
int  req 
)
inlinestatic

Definition at line 333 of file nm_headers.h.

References NM_PROTO_DEBUG, nm_header_debug_s::proto_id, req, and nm_header_debug_s::req.

◆ nm_header_init_msg()

static void nm_header_init_msg ( union nm_header_ctrl_generic_s p_ctrl,
nm_core_tag_t  tag_id,
nm_seq_t  seq,
nm_len_t  msg_len 
)
inlinestatic

Definition at line 287 of file nm_headers.h.

References nm_header_ctrl_generic_s::msg, msg_len, nm_header_msg_s::msg_len, NM_PROTO_MSG, nm_header_msg_s::proto_id, seq, nm_header_msg_s::seq, tag_id, and nm_header_msg_s::tag_id.

Referenced by nm_core_post_msg().

Here is the caller graph for this function:

◆ nm_header_init_pkt_data()

◆ nm_header_init_rdv()

◆ nm_header_init_rtr()

static void nm_header_init_rtr ( union nm_header_ctrl_generic_s p_ctrl,
nm_core_tag_t  tag,
nm_seq_t  seq,
nm_trk_id_t  trk_id,
nm_len_t  chunk_offset,
nm_len_t  chunk_len,
const void *  p_rdv_data 
)
inlinestatic

◆ nm_header_init_short_data()

static void nm_header_init_short_data ( struct nm_header_short_data_s p_header,
nm_core_tag_t  tag_id,
nm_seq_t  seq,
nm_len_t  len 
)
inlinestatic

◆ PUK_LIST_CREATE_FUNCS()

PUK_LIST_CREATE_FUNCS ( nm_ctrl_chunk  )

◆ PUK_LIST_DECLARE_TYPE()

PUK_LIST_DECLARE_TYPE ( nm_ctrl_chunk  )

Variable Documentation

◆ __attribute__

struct nm_ctrl_chunk_s __attribute__

◆ chunk_len

◆ chunk_offset

nm_len_t chunk_offset

offset of the enclosed chunk

offset of this chunk relative to full message

Definition at line 4 of file nm_headers.h.

Referenced by nm_core_post_rtr(), nm_data_excerpt_build(), nm_header_init_data(), nm_header_init_pkt_data(), nm_header_init_rdv(), nm_header_init_rtr(), and nm_req_chunk_init().

◆ data_len

nm_len_t data_len

length of data enclosed

Definition at line 3 of file nm_headers.h.

◆ hlen

uint16_t hlen

length in header (header + data in header)

Definition at line 5 of file nm_headers.h.

Referenced by nm_core_pack_set_hlen(), nm_rpc_recv_header(), nm_rpc_send(), and nm_sr_send_header().

◆ len

◆ msg_len

nm_len_t msg_len

length of the full message

Definition at line 3 of file nm_headers.h.

Referenced by nm_core_post_msg(), and nm_header_init_msg().

◆ priority

nm_prio_t priority

Definition at line 6 of file nm_headers.h.

Referenced by nm_rpc_req_set_priority(), and nm_sr_send_set_priority().

◆ proto_id

nm_proto_t proto_id

proto ID- should be NM_PROTO_PKT_DATA

proto ID- should be NM_PROTO_ACK

proto ID- should be NM_PROTO_RTR

proto ID- should be NM_PROTO_RDV

proto ID- should be NM_PROTO_MSG

proto ID- should be NM_PROTO_SHORT_DATA

proto ID- should be NM_PROTO_SMALL_DATA

Definition at line 0 of file nm_headers.h.

◆ rdv_data

char rdv_data[NM_HEADER_RTR_DATA_SIZE]

Definition at line 6 of file nm_headers.h.

Referenced by nm_minidriver_recv_rdv(), and nm_minidriver_send_rdv().

◆ req

uint64_t req

a type of debug request; unused for now

Examples
nm_onesided_queues.c, and nm_onesided_simple.c.

Definition at line 1 of file nm_headers.h.

Referenced by nm_header_init_debug().

◆ seq

◆ skip

uint16_t skip

skip value for iovec

skip offset for data buffer, relative to v0 end (0xFFFF for inline data)

Definition at line 1 of file nm_headers.h.

Referenced by nm_header_init_data().

◆ tag_id

nm_core_tag_t tag_id

tag for the message

tag of the acknowledged data

Definition at line 1 of file nm_headers.h.

Referenced by nm_header_init_data(), nm_header_init_msg(), nm_header_init_pkt_data(), and nm_header_init_short_data().

◆ trk_id

nm_trk_id_t trk_id

index of the track relative to the gate

Definition at line 3 of file nm_headers.h.

Referenced by nm_core_post_rtr(), nm_header_init_rtr(), and nm_pw_assign().

◆ v0len

uint16_t v0len

size of v0 actually used ( == offset value to reach v[1] )

Definition at line 0 of file nm_headers.h.

Referenced by nm_header_global_finalize().