Data Structures

struct  csp_cmp_message
 

Macros

#define CSP_CMP_REQUEST   0x00
 
#define CSP_CMP_REPLY   0xff
 
#define CSP_CMP_IDENT   1
 
#define CSP_CMP_IDENT_REV_LEN   20
 
#define CSP_CMP_IDENT_DATE_LEN   12
 
#define CSP_CMP_IDENT_TIME_LEN   9
 
#define CSP_CMP_ROUTE_SET   2
 
#define CSP_CMP_ROUTE_IFACE_LEN   11
 
#define CSP_CMP_IF_STATS   3
 
#define CSP_CMP_PEEK   4
 
#define CSP_CMP_PEEK_MAX_LEN   200
 
#define CSP_CMP_POKE   5
 
#define CSP_CMP_POKE_MAX_LEN   200
 
#define CSP_CMP_CLOCK   6
 
#define CMP_SIZE(_memb)   (sizeof(((struct csp_cmp_message *)0)->_memb) + sizeof(uint8_t) + sizeof(uint8_t))
 
#define CMP_MESSAGE(_code, _memb)
 

Functions

int csp_cmp (uint8_t node, uint32_t timeout, uint8_t code, int membsize, struct csp_cmp_message *msg)
 

Data Structure Documentation

struct csp_cmp_message

Data Fields

uint8_t type
 
uint8_t code
 
union {
   struct {
      char   hostname [CSP_HOSTNAME_LEN]
 
      char   model [CSP_MODEL_LEN]
 
      char   revision [CSP_CMP_IDENT_REV_LEN]
 
      char   date [CSP_CMP_IDENT_DATE_LEN]
 
      char   time [CSP_CMP_IDENT_TIME_LEN]
 
   }   ident
 
   struct {
      uint8_t   dest_node
 
      uint8_t   next_hop_mac
 
      char   interface [CSP_CMP_ROUTE_IFACE_LEN]
 
   }   route_set
 
   struct {
      char   interface [CSP_CMP_ROUTE_IFACE_LEN]
 
      uint32_t   tx
 
      uint32_t   rx
 
      uint32_t   tx_error
 
      uint32_t   rx_error
 
      uint32_t   drop
 
      uint32_t   autherr
 
      uint32_t   frame
 
      uint32_t   txbytes
 
      uint32_t   rxbytes
 
      uint32_t   irq
 
   }   if_stats
 
   struct {
      uint32_t   addr
 
      uint8_t   len
 
      char   data [CSP_CMP_PEEK_MAX_LEN]
 
   }   peek
 
   struct {
      uint32_t   addr
 
      uint8_t   len
 
      char   data [CSP_CMP_POKE_MAX_LEN]
 
   }   poke
 
   csp_timestamp_t   clock
 
}; 
 

Field Documentation

union { ... }
uint32_t csp_cmp_message::addr
uint32_t csp_cmp_message::autherr
csp_timestamp_t csp_cmp_message::clock
uint8_t csp_cmp_message::code
char csp_cmp_message::data[CSP_CMP_POKE_MAX_LEN]
char csp_cmp_message::date[CSP_CMP_IDENT_DATE_LEN]
uint8_t csp_cmp_message::dest_node
uint32_t csp_cmp_message::drop
uint32_t csp_cmp_message::frame
char csp_cmp_message::hostname[CSP_HOSTNAME_LEN]
struct { ... } csp_cmp_message::ident
struct { ... } csp_cmp_message::if_stats
char csp_cmp_message::interface[CSP_CMP_ROUTE_IFACE_LEN]
uint32_t csp_cmp_message::irq
uint8_t csp_cmp_message::len
char csp_cmp_message::model[CSP_MODEL_LEN]
uint8_t csp_cmp_message::next_hop_mac
struct { ... } csp_cmp_message::peek
struct { ... } csp_cmp_message::poke
char csp_cmp_message::revision[CSP_CMP_IDENT_REV_LEN]
struct { ... } csp_cmp_message::route_set
uint32_t csp_cmp_message::rx
uint32_t csp_cmp_message::rx_error
uint32_t csp_cmp_message::rxbytes
char csp_cmp_message::time[CSP_CMP_IDENT_TIME_LEN]
uint32_t csp_cmp_message::tx
uint32_t csp_cmp_message::tx_error
uint32_t csp_cmp_message::txbytes
uint8_t csp_cmp_message::type

Macro Definition Documentation

#define CMP_MESSAGE (   _code,
  _memb 
)
Value:
static inline int csp_cmp_##_memb(uint8_t node, uint32_t timeout, struct csp_cmp_message *msg) { \
return csp_cmp(node, timeout, _code, CMP_SIZE(_memb), msg); \
}
#define CMP_SIZE(_memb)
Definition: csp_cmp.h:97
Definition: csp_cmp.h:54
int csp_cmp(uint8_t node, uint32_t timeout, uint8_t code, int membsize, struct csp_cmp_message *msg)
#define CMP_SIZE (   _memb)    (sizeof(((struct csp_cmp_message *)0)->_memb) + sizeof(uint8_t) + sizeof(uint8_t))
#define CSP_CMP_CLOCK   6
#define CSP_CMP_IDENT   1
#define CSP_CMP_IDENT_DATE_LEN   12
#define CSP_CMP_IDENT_REV_LEN   20
#define CSP_CMP_IDENT_TIME_LEN   9
#define CSP_CMP_IF_STATS   3
#define CSP_CMP_PEEK   4
#define CSP_CMP_PEEK_MAX_LEN   200
#define CSP_CMP_POKE   5
#define CSP_CMP_POKE_MAX_LEN   200
#define CSP_CMP_REPLY   0xff
#define CSP_CMP_REQUEST   0x00
#define CSP_CMP_ROUTE_IFACE_LEN   11
#define CSP_CMP_ROUTE_SET   2

Function Documentation

int csp_cmp ( uint8_t  node,
uint32_t  timeout,
uint8_t  code,
int  membsize,
struct csp_cmp_message msg 
)