Permalink
Browse files

Added support for R bit and I bit in ECM Map Register messages.

  • Loading branch information...
1 parent 1219a63 commit 4cf09c37f45d3d83586e2c7b050e01e8eaa016fe @arnatal committed Apr 27, 2012
Showing with 27 additions and 12 deletions.
  1. +14 −4 lispd/lispd.h
  2. +13 −8 lispd/lispd_nat_lib.c
View
@@ -431,7 +431,7 @@ typedef struct lispd_pkt_mapping_record_locator_t_ {
* 0 1 2 3
* 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
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * |Type=3 |P| Reserved |M| Record Count |
+ * |Type=3 |P| |I|R| Reserved |M| Record Count |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Nonce . . . |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -457,17 +457,27 @@ typedef struct lispd_pkt_mapping_record_locator_t_ {
* +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
+/* I and R bit are defined in NAT tarversal draft*/
+
typedef struct lispd_pkt_map_register_t_ {
#ifdef LITTLE_ENDIAN
- uint8_t reserved1:3;
+ uint8_t ibit:1;
+ uint8_t reserved1:2;
uint8_t proxy_reply:1;
uint8_t lisp_type:4;
#else
uint8_t lisp_type:4;
uint8_t proxy_reply:1;
- uint8_t reserved1:3;
+ uint8_t reserved1:2;
+ uint8_t ibit:1;
#endif
- uint8_t reserved2;
+#ifdef LITTLE_ENDIAN
+ uint8_t reserved2:7;
+ uint8_t rbit:1;
+#else
+ uint8_t rbit:1;
+ uint8_t reserved2:7;
+#endif
#ifdef LITTLE_ENDIAN
uint8_t map_notify:1;
uint8_t reserved3:7;
View
@@ -928,21 +928,26 @@ char *key;
/* Map Server proxy reply */
map_register_pkt->proxy_reply = proxy_reply;
+ /* R bit always 1 for Map Registers sent to the RTR */
+ map_register_pkt->rbit = 1;
+
+ /* MN does not use xTR-ID for the momment */
+ map_register_pkt->ibit = 0;
+
complete_auth_fields(key_id,
&(map_register_pkt->key_id),
key,
(void *) (map_register_pkt),
map_register_pkt_len,
&(map_register_pkt->auth_data));
- ecm_map_register =
- build_control_encap_pkt((uint8_t *) map_register_pkt,
- map_register_pkt_len,
- inner_addr_from,
- inner_addr_dest,
- inner_port_from,
- inner_port_dest,
- &ecm_map_register_len);
+ ecm_map_register = build_control_encap_pkt((uint8_t *) map_register_pkt,
+ map_register_pkt_len,
+ inner_addr_from,
+ inner_addr_dest,
+ inner_port_from,
+ inner_port_dest,
+ &ecm_map_register_len);
free(map_register_pkt);
if (ecm_map_register == NULL) {

0 comments on commit 4cf09c3

Please sign in to comment.