2 * Copyright (c) 2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef VNET_LISP_GPE_LISP_CP_MESSAGES_H_
17 #define VNET_LISP_GPE_LISP_CP_MESSAGES_H_
19 #include <vnet/vnet.h>
21 #define MAX_IP_PKT_LEN 4096
22 #define MAX_IP_HDR_LEN 40 /* without options or IPv6 hdr extensions */
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
36 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
37 * / | Reserved | EID mask-len | EID-prefix-AFI |
38 * Rec +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
39 * \ | EID-prefix ... |
40 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44 typedef struct _eid_prefix_record_hdr
48 } __attribute__ ((__packed__)) eid_record_hdr_t;
50 void eid_rec_hdr_init (eid_record_hdr_t * ptr);
52 #define EID_REC_CAST(h_) ((eid_record_hdr_t *)(h_))
53 #define EID_REC_MLEN(h_) EID_REC_CAST((h_))->eid_prefix_length
54 #define EID_REC_ADDR(h) (u8 *)(h) + sizeof(eid_record_hdr_t)
65 LISP_ENCAP_CONTROL_TYPE = 8,
70 * ENCAPSULATED CONTROL MESSAGE
75 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
76 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
77 * / | IPv4 or IPv6 Header |
78 * OH | (uses RLOC addresses) |
80 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
81 * / | Source Port = xxxx | Dest Port = 4342 |
82 * UDP +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
83 * \ | UDP Length | UDP Checksum |
84 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
85 * LH |Type=8 |S| Reserved |
86 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
87 * / | IPv4 or IPv6 Header |
88 * IH | (uses RLOC or EID addresses) |
90 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
91 * / | Source Port = xxxx | Dest Port = yyyy |
92 * UDP +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
93 * \ | UDP Length | UDP Checksum |
94 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
95 * LCM | LISP Control Message |
96 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
101 * Encapsulated control message header. This is followed by the IP
102 * header of the encapsulated LISP control message.
104 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
105 * |Type=8 |S| Reserved |
106 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
111 #if CLIB_ARCH_IS_LITTLE_ENDIAN
123 char *ecm_hdr_to_char (ecm_hdr_t * h);
125 #define ECM_TYPE(h_) ((ecm_hdr_t *)(h_))->type
128 * MAP-REQUEST MESSAGE
132 * Map-Request Message Format
135 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
136 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
137 * |Type=1 |A|M|P|S|p|s| Reserved | IRC | Record Count |
138 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
140 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
142 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
143 * | Source-EID-AFI | Source EID Address ... |
144 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
145 * | ITR-RLOC-AFI 1 | ITR-RLOC Address 1 ... |
146 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
148 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
149 * | ITR-RLOC-AFI n | ITR-RLOC Address n ... |
150 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
151 * / | Reserved | EID mask-len | EID-prefix-AFI |
152 * Rec +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
153 * \ | EID-prefix ... |
154 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
155 * | Map-Reply Record ... |
156 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
157 * | Mapping Protocol Data |
158 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
163 * Fixed size portion of the map request. Variable size source EID
164 * address, originating ITR RLOC AFIs and addresses and then map
165 * request records follow.
169 #if CLIB_ARCH_IS_LITTLE_ENDIAN
170 u8 solicit_map_request:1;
172 u8 map_data_present:1;
178 u8 map_data_present:1;
180 u8 solicit_map_request:1;
182 #if CLIB_ARCH_IS_LITTLE_ENDIAN
191 #if CLIB_ARCH_IS_LITTLE_ENDIAN
192 u8 additional_itr_rloc_count:5;
196 u8 additional_itr_rloc_count:5;
200 } __attribute__ ((__packed__)) map_request_hdr_t;
202 void map_request_hdr_init (void *ptr);
203 char *map_request_hdr_to_char (map_request_hdr_t * h);
205 #define MREQ_TYPE(h_) (h_)->type
206 #define MREQ_HDR_CAST(h_) ((map_request_hdr_t *)(h_))
207 #define MREQ_REC_COUNT(h_) (MREQ_HDR_CAST(h_))->record_count
208 #define MREQ_RLOC_PROBE(h_) (MREQ_HDR_CAST(h_))->rloc_probe
209 #define MREQ_ITR_RLOC_COUNT(h_) (MREQ_HDR_CAST(h_))->additional_itr_rloc_count
210 #define MREQ_NONCE(h_) (MREQ_HDR_CAST(h_))->nonce
211 #define MREQ_SMR(h_) (MREQ_HDR_CAST(h_))->solicit_map_request
212 #define MREQ_SMR_INVOKED(h_) (MREQ_HDR_CAST(h_))->smr_invoked
219 * Map-Reply Message Format
222 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
223 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
224 * |Type=2 |P|E|S| Reserved | Record Count |
225 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
227 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
229 * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
231 * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
232 * R | Locator Count | EID mask-len | ACT |A| Reserved |
233 * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
234 * c | Rsvd | Map-Version Number | EID-AFI |
235 * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
237 * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
238 * | /| Priority | Weight | M Priority | M Weight |
239 * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
240 * | o | Unused Flags |L|p|R| Loc-AFI |
241 * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
243 * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
244 * | Mapping Protocol Data |
245 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
249 * Fixed size portion of the map reply.
253 #if CLIB_ARCH_IS_LITTLE_ENDIAN
270 } __attribute__ ((__packed__)) map_reply_hdr_t;
272 void map_reply_hdr_init (void *ptr);
273 char *map_reply_hdr_to_char (map_reply_hdr_t * h);
275 #define MREP_TYPE(h_) MREP_HDR_CAST(h_)->type
276 #define MREP_HDR_CAST(h_) ((map_reply_hdr_t *)(h_))
277 #define MREP_REC_COUNT(h_) MREP_HDR_CAST(h_)->record_count
278 #define MREP_RLOC_PROBE(h_) MREP_HDR_CAST(h_)->rloc_probe
279 #define MREP_NONCE(h_) MREP_HDR_CAST(h_)->nonce
282 always_inline lisp_msg_type_e
283 lisp_msg_type (void *b)
288 return (NOT_LISP_MSG);
294 increment_record_count (void *b)
296 switch (lisp_msg_type (b))
298 case LISP_MAP_REQUEST:
299 MREQ_REC_COUNT (b) += 1;
302 MREP_REC_COUNT (b) += 1;
313 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
314 * /| Priority | Weight | M Priority | M Weight |
315 * L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
316 * o | Unused Flags |L|p|R| Loc-AFI |
317 * c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
319 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
321 * Fixed portion of the mapping record locator. Variable length
322 * locator address follows.
324 typedef struct _locator_hdr
331 #ifdef CLIB_ARCH_IS_LITTLE_ENDIAN
342 } __attribute__ ((__packed__)) locator_hdr_t;
344 #define LOC_CAST(h_) ((locator_hdr_t *)(h_))
345 #define LOC_PROBED(h_) LOC_CAST(h_)->probed
346 #define LOC_PRIORITY(h_) LOC_CAST(h_)->priority
347 #define LOC_WEIGHT(h_) LOC_CAST(h_)->weight
348 #define LOC_MPRIORITY(h_) LOC_CAST(h_)->mpriority
349 #define LOC_MWEIGHT(h_) LOC_CAST(h_)->mweight
350 #define LOC_REACHABLE(h_) LOC_CAST(h_)->reachable
351 #define LOC_LOCAL(h_) LOC_CAST(h_)->local
352 #define LOC_ADDR(h_) ((u8 *)(h_) + sizeof(locator_hdr_t))
357 * Mapping record used in all LISP control messages.
359 * +---> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
361 * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
362 * R | Locator Count | EID mask-len | ACT |A| Reserved |
363 * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
364 * c | Rsvd | Map-Version Number | EID-AFI |
365 * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
367 * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
368 * | /| Priority | Weight | M Priority | M Weight |
369 * | / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
370 * | Loc | Unused Flags |L|p|R| Loc-AFI |
371 * | \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
373 * +---> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
377 * Fixed portion of the mapping record. EID prefix address and
381 typedef struct _mapping_record_hdr_t
385 u8 eid_prefix_length;
386 #ifdef CLIB_ARCH_IS_LITTLE_ENDIAN
396 #ifdef CLIB_ARCH_IS_LITTLE_ENDIAN
404 } __attribute__ ((__packed__)) mapping_record_hdr_t;
406 void mapping_record_init_hdr (mapping_record_hdr_t * h);
408 #define MAP_REC_EID_PLEN(h) ((mapping_record_hdr_t *)(h))->eid_prefix_length
409 #define MAP_REC_LOC_COUNT(h) ((mapping_record_hdr_t *)(h))->locator_count
410 #define MAP_REC_ACTION(h) ((mapping_record_hdr_t *)(h))->action
411 #define MAP_REC_AUTH(h) ((mapping_record_hdr_t *)(h))->authoritative
412 #define MAP_REC_TTL(h) ((mapping_record_hdr_t *)(h))->ttl
413 #define MAP_REC_EID(h) (u8 *)(h)+sizeof(mapping_record_hdr_t)
414 #define MAP_REC_VERSION(h) (h)->version_hi << 8 | (h)->version_low
420 LISP_SEND_MAP_REQUEST,
424 typedef enum lisp_authoritative
426 A_NO_AUTHORITATIVE = 0,
428 } lisp_authoritative_e;
431 * LISP Canonical Address Format Encodings
434 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
435 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
436 * | AFI = 16387 | Rsvd1 | Flags |
437 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
438 * | Type | Rsvd2 | Length |
439 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
442 typedef struct _lcaf_hdr_t
449 } __attribute__ ((__packed__)) lcaf_hdr_t;
451 #define LCAF_TYPE(h) ((lcaf_hdr_t *)(h))->type
452 #define LCAF_LENGTH(h) ((lcaf_hdr_t *)(h))->len
453 #define LCAF_RES2(h) ((lcaf_hdr_t *)(h))->reserved2
454 #define LCAF_FLAGS(h) ((lcaf_hdr_t *)(h))->flags
455 #define LCAF_PAYLOAD(h) (u8 *)(h)+sizeof(lcaf_hdr_t)
458 * Source/Dest Key Canonical Address Format:
461 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
462 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
463 * | Reserved | Source-ML | Dest-ML |
464 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
466 typedef struct _lcaf_src_dst_hdr_t
471 } __attribute__ ((__packed__)) lcaf_src_dst_hdr_t;
473 #define LCAF_SD_SRC_ML(_h) (_h)->src_mask_len
474 #define LCAF_SD_DST_ML(_h) (_h)->dst_mask_len
480 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
481 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
482 * | Service Path ID | Service index |
483 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
485 typedef struct _lcaf_spi_hdr_t
488 } __attribute__ ((__packed__)) lcaf_spi_hdr_t;
490 #define LCAF_SPI_SI(_h) (_h)->spi_si
493 * The Map-Register message format is:
496 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
497 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
498 * |Type=3 |P| Reserved |M| Record Count |
499 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
501 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
503 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
504 * | Key ID | Authentication Data Length |
505 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
506 * ~ Authentication Data ~
507 * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
509 * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
510 * R | Locator Count | EID mask-len | ACT |A| Reserved |
511 * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
512 * c | Rsvd | Map-Version Number | EID-Prefix-AFI |
513 * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
515 * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
516 * | /| Priority | Weight | M Priority | M Weight |
517 * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
518 * | o | Unused Flags |L|p|R| Loc-AFI |
519 * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
521 * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
525 #if CLIB_ARCH_IS_LITTLE_ENDIAN
527 u8 proxy_map_reply:1;
531 u8 proxy_map_reply:1;
537 #if CLIB_ARCH_IS_LITTLE_ENDIAN
538 u8 want_map_notify:1;
542 u8 want_map_notify:1;
550 } __attribute__ ((__packed__)) map_register_hdr_t;
552 #define MREG_TYPE(h_) (h_)->type
553 #define MREG_HDR_CAST(h_) ((map_register_hdr_t *)(h_))
554 #define MREG_PROXY_MR(h_) (MREG_HDR_CAST(h_))->proxy_map_reply
555 #define MREG_WANT_MAP_NOTIFY(h_) (MREG_HDR_CAST(h_))->want_map_notify
556 #define MREG_REC_COUNT(h_) (MREG_HDR_CAST(h_))->record_count
557 #define MREG_NONCE(h_) (MREG_HDR_CAST(h_))->nonce
558 #define MREG_KEY_ID(h_) (MREG_HDR_CAST(h_))->key_id
559 #define MREG_AUTH_DATA_LEN(h_) (MREG_HDR_CAST(h_))->auth_data_len
560 #define MREG_DATA(h_) (MREG_HDR_CAST(h_))->data
563 * The Map-Notify message format is:
566 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
567 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
568 * |Type=4 | Reserved | Record Count |
569 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
571 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
573 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
574 * | Key ID | Authentication Data Length |
575 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
576 * ~ Authentication Data ~
577 * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
579 * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
580 * R | Locator Count | EID mask-len | ACT |A| Reserved |
581 * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582 * c | Rsvd | Map-Version Number | EID-Prefix-AFI |
583 * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
585 * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
586 * | /| Priority | Weight | M Priority | M Weight |
587 * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
588 * | o | Unused Flags |L|p|R| Loc-AFI |
589 * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
591 * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
596 #if CLIB_ARCH_IS_LITTLE_ENDIAN
611 } __attribute__ ((__packed__)) map_notify_hdr_t;
613 #define MNOTIFY_TYPE(h_) (h_)->type
614 #define MNOTIFY_HDR_CAST(h_) ((map_register_hdr_t *)(h_))
615 #define MNOTIFY_REC_COUNT(h_) (MREG_HDR_CAST(h_))->record_count
616 #define MNOTIFY_NONCE(h_) (MREG_HDR_CAST(h_))->nonce
617 #define MNOTIFY_KEY_ID(h_) (MREG_HDR_CAST(h_))->key_id
618 #define MNOTIFY_AUTH_DATA_LEN(h_) (MREG_HDR_CAST(h_))->auth_data_len
619 #define MNOTIFY_DATA(h_) (MREG_HDR_CAST(h_))->data
622 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
623 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
624 * |Ver|O|C|R|R|R|R|R|R| Length | MD type=0x1 | Next Protocol |
625 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
626 * | Service Path Identifer | Service Index |
627 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
634 } __attribute__ ((__packed__)) lisp_nsh_hdr_t;
636 #endif /* VNET_LISP_GPE_LISP_CP_MESSAGES_H_ */
639 * fd.io coding-style-patch-verification: ON
642 * eval: (c-set-style "gnu")