16 #ifndef VNET_LISP_GPE_LISP_CP_MESSAGES_H_ 17 #define VNET_LISP_GPE_LISP_CP_MESSAGES_H_ 21 #define MAX_IP_PKT_LEN 4096 22 #define MAX_IP_HDR_LEN 40 24 #define LISP_DATA_HDR_LEN 8 25 #define LISP_ECM_HDR_LEN 4 26 #define MAX_LISP_MSG_ENCAP_LEN 2*(MAX_IP_HDR_LEN + UDP_HDR_LEN)+ LISP_ECM_HDR_LEN 27 #define MAX_LISP_PKT_ENCAP_LEN MAX_IP_HDR_LEN + UDP_HDR_LEN + LISP_DATA_HDR_LEN 29 #define LISP_CONTROL_PORT 4342 44 typedef struct _eid_prefix_record_hdr {
51 #define EID_REC_CAST(h_) ((eid_record_hdr_t *)(h_)) 52 #define EID_REC_MLEN(h_) EID_REC_CAST((h_))->eid_prefix_length 53 #define EID_REC_ADDR(h) (u8 *)(h) + sizeof(eid_record_hdr_t) 110 #if CLIB_ARCH_IS_LITTLE_ENDIAN 124 #define ECM_TYPE(h_) ((ecm_hdr_t *)(h_))->type 168 #if CLIB_ARCH_IS_LITTLE_ENDIAN 169 u8 solicit_map_request:1;
171 u8 map_data_present:1;
177 u8 map_data_present:1;
179 u8 solicit_map_request:1;
181 #if CLIB_ARCH_IS_LITTLE_ENDIAN 190 #if CLIB_ARCH_IS_LITTLE_ENDIAN 191 u8 additional_itr_rloc_count:5;
195 u8 additional_itr_rloc_count:5;
204 #define MREQ_TYPE(h_) (h_)->type 205 #define MREQ_HDR_CAST(h_) ((map_request_hdr_t *)(h_)) 206 #define MREQ_REC_COUNT(h_) (MREQ_HDR_CAST(h_))->record_count 207 #define MREQ_RLOC_PROBE(h_) (MREQ_HDR_CAST(h_))->rloc_probe 208 #define MREQ_ITR_RLOC_COUNT(h_) (MREQ_HDR_CAST(h_))->additional_itr_rloc_count 209 #define MREQ_NONCE(h_) (MREQ_HDR_CAST(h_))->nonce 210 #define MREQ_SMR(h_) (MREQ_HDR_CAST(h_))->solicit_map_request 211 #define MREQ_SMR_INVOKED(h_) (MREQ_HDR_CAST(h_))->smr_invoked 218 #define LISP_ACTION_NO_ACTION 0 219 #define LISP_ACTION_FORWARD 1 220 #define LISP_ACTION_DROP 2 221 #define LISP_ACTION_SEND_MAP_REQUEST 3 258 #if CLIB_ARCH_IS_LITTLE_ENDIAN 280 #define MREP_HDR_CAST(h_) ((map_reply_hdr_t *)(h_)) 281 #define MREP_REC_COUNT(h_) MREP_HDR_CAST(h_)->record_count 282 #define MREP_RLOC_PROBE(h_) MREP_HDR_CAST(h_)->rloc_probe 283 #define MREP_NONCE(h_) MREP_HDR_CAST(h_)->nonce 328 typedef struct _locator_hdr {
334 #ifdef CLIB_ARCH_IS_LITTLE_ENDIAN 347 #define LOC_CAST(h_) ((locator_hdr_t *)(h_)) 348 #define LOC_PROBED(h_) LOC_CAST(h_)->probed 349 #define LOC_PRIORITY(h_) LOC_CAST(h_)->priority 350 #define LOC_WEIGHT(h_) LOC_CAST(h_)->weight 351 #define LOC_MPRIORITY(h_) LOC_CAST(h_)->mpriority 352 #define LOC_MWEIGHT(h_) LOC_CAST(h_)->mweight 353 #define LOC_REACHABLE(h_) LOC_CAST(h_)->reachable 354 #define LOC_LOCAL(h_) LOC_CAST(h_)->local 355 #define LOC_ADDR(h_) ((u8 *)(h_) + sizeof(locator_hdr_t)) 384 typedef struct _mapping_record_hdr_t
388 u8 eid_prefix_length;
389 #ifdef CLIB_ARCH_IS_LITTLE_ENDIAN 399 #ifdef CLIB_ARCH_IS_LITTLE_ENDIAN 411 #define MAP_REC_EID_PLEN(h) ((mapping_record_hdr_t *)(h))->eid_prefix_length 412 #define MAP_REC_LOC_COUNT(h) ((mapping_record_hdr_t *)(h))->locator_count 413 #define MAP_REC_ACTION(h) ((mapping_record_hdr_t *)(h))->action 414 #define MAP_REC_AUTH(h) ((mapping_record_hdr_t *)(h))->authoritative 415 #define MAP_REC_TTL(h) ((mapping_record_hdr_t *)(h))->ttl 416 #define MAP_REC_EID(h) (u8 *)(h)+sizeof(mapping_record_hdr_t) 417 #define MAP_REC_VERSION(h) (h)->version_hi << 8 | (h)->version_low 445 typedef struct _lcaf_hdr_t
454 #define LCAF_TYPE(h) ((lcaf_hdr_t *)(h))->type 455 #define LCAF_LENGTH(h) ((lcaf_hdr_t *)(h))->len 456 #define LCAF_RES2(h) ((lcaf_hdr_t *)(h))->reserved2 457 #define LCAF_FLAGS(h) ((lcaf_hdr_t *)(h))->flags 458 #define LCAF_PAYLOAD(h) (u8 *)(h)+sizeof(lcaf_hdr_t) #define MREP_REC_COUNT(h_)
void eid_rec_hdr_init(eid_record_hdr_t *ptr)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
#define MREQ_REC_COUNT(h_)
struct _eid_prefix_record_hdr eid_record_hdr_t
char * map_reply_hdr_to_char(map_reply_hdr_t *h)
enum lisp_authoritative lisp_authoritative_e
always_inline void increment_record_count(void *b)
enum lisp_actions lisp_action_e
char * ecm_hdr_to_char(ecm_hdr_t *h)
void mapping_record_init_hdr(mapping_record_hdr_t *h)
void map_request_hdr_init(void *ptr)
char * map_request_hdr_to_char(map_request_hdr_t *h)
struct _mapping_record_hdr_t mapping_record_hdr_t
struct _lcaf_hdr_t lcaf_hdr_t
struct _locator_hdr locator_hdr_t
void map_reply_hdr_init(void *ptr)
always_inline lisp_msg_type_e lisp_msg_type(void *b)