Commit c18eb1e1 authored by Baptiste Jonglez's avatar Baptiste Jonglez Committed by Juliusz Chroboczek

Give names to the various types of sub-TLV

parent aa85696d
...@@ -127,7 +127,7 @@ parse_route_attributes(const unsigned char *a, int alen, ...@@ -127,7 +127,7 @@ parse_route_attributes(const unsigned char *a, int alen,
while(i < alen) { while(i < alen) {
type = a[i]; type = a[i];
if(type == 0) { if(type == SUBTLV_PAD1) {
i++; i++;
continue; continue;
} }
...@@ -142,9 +142,9 @@ parse_route_attributes(const unsigned char *a, int alen, ...@@ -142,9 +142,9 @@ parse_route_attributes(const unsigned char *a, int alen,
return; return;
} }
if(type == 1) { if(type == SUBTLV_PADN) {
/* Nothing. */ /* Nothing. */
} else if(type == 2) { } else if(type == SUBTLV_DIVERSITY) {
if(len > DIVERSITY_HOPS) { if(len > DIVERSITY_HOPS) {
fprintf(stderr, fprintf(stderr,
"Received overlong channel information (%d > %d).\n", "Received overlong channel information (%d > %d).\n",
......
...@@ -25,6 +25,9 @@ THE SOFTWARE. ...@@ -25,6 +25,9 @@ THE SOFTWARE.
#define BUCKET_TOKENS_MAX 200 #define BUCKET_TOKENS_MAX 200
#define BUCKET_TOKENS_PER_SEC 40 #define BUCKET_TOKENS_PER_SEC 40
/* A registry of assigned TLV and sub-TLV types is available at
http://www.pps.univ-paris-diderot.fr/~jch/software/babel/babel-tlv-registry.text
*/
#define MESSAGE_PAD1 0 #define MESSAGE_PAD1 0
#define MESSAGE_PADN 1 #define MESSAGE_PADN 1
#define MESSAGE_ACK_REQ 2 #define MESSAGE_ACK_REQ 2
...@@ -37,6 +40,10 @@ THE SOFTWARE. ...@@ -37,6 +40,10 @@ THE SOFTWARE.
#define MESSAGE_REQUEST 9 #define MESSAGE_REQUEST 9
#define MESSAGE_MH_REQUEST 10 #define MESSAGE_MH_REQUEST 10
/* Protocol extension through sub-TLVs. */
#define SUBTLV_PAD1 0
#define SUBTLV_PADN 1
#define SUBTLV_DIVERSITY 2 /* Also known as babelz. */
extern unsigned short myseqno; extern unsigned short myseqno;
extern struct timeval seqno_time; extern struct timeval seqno_time;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment