@@ -36,7 +36,8 @@ void sendHelloMessageEx(
3636 uint8_t tos ,
3737 const ethernet_address_t * mapperRealAddress ,
3838 const ethernet_address_t * mapperApparentAddress ,
39- uint16_t generation
39+ uint16_t generation ,
40+ hello_tx_reason_t reason
4041) {
4142 uint8_t * buffer = calloc (1 , currentNetworkInterface -> MTU );
4243 if (!buffer ) {
@@ -77,7 +78,8 @@ void sendHelloMessageEx(
7778 );
7879
7980 const char * gen_store = (tos == tos_quick_discovery ) ? "quick" : "topology" ;
80- log_debug ("sendHelloMessageEx(): %s mapper_id=" ETHERNET_ADDR_FMT " tos=%u opcode=0x%x seq=%u seq_wire=0x%02x%02x gen_host=0x%04x gen_wire=0x%02x%02x gen_store=%s curMapper="
81+ const char * reason_str = (reason == hello_reason_reply_to_discover ) ? "reply_to_discover" : "hello_timeout" ;
82+ log_debug ("sendHelloMessageEx(): %s mapper_id=" ETHERNET_ADDR_FMT " tos=%u opcode=0x%x seq=%u seq_wire=0x%02x%02x gen_host=0x%04x gen_wire=0x%02x%02x gen_store=%s reason=%s curMapper="
8183 ETHERNET_ADDR_FMT " appMapper=" ETHERNET_ADDR_FMT ,
8284 currentNetworkInterface -> deviceName ,
8385 ETHERNET_ADDR (mapperRealAddress -> a ),
@@ -90,8 +92,18 @@ void sendHelloMessageEx(
9092 ((uint8_t * )& helloHeader -> generation )[0 ],
9193 ((uint8_t * )& helloHeader -> generation )[1 ],
9294 gen_store ,
95+ reason_str ,
9396 ETHERNET_ADDR (mapperRealAddress -> a ),
9497 ETHERNET_ADDR (mapperApparentAddress -> a ));
98+ log_debug ("t=%llu TX %s tos=%u op=%u xid=0x%04x gen=0x%04x seq=0x%04x reason=%s" ,
99+ (unsigned long long )lltd_monotonic_milliseconds (),
100+ currentNetworkInterface -> deviceName ,
101+ tos ,
102+ opcode_hello ,
103+ 0 ,
104+ generation ,
105+ seqNumber ,
106+ reason_str );
95107
96108 // Add Station TLVs
97109 offset += setHostIdTLV (buffer , offset , currentNetworkInterface );
@@ -147,7 +159,8 @@ void sendHelloMessage(void *networkInterface) {
147159 tos_discovery ,
148160 (const ethernet_address_t * )(const void * )& currentNetworkInterface -> MapperHwAddress ,
149161 (const ethernet_address_t * )(const void * )& currentNetworkInterface -> MapperHwAddress ,
150- currentNetworkInterface -> MapperGenerationTopology
162+ currentNetworkInterface -> MapperGenerationTopology ,
163+ hello_reason_periodic_timeout
151164 );
152165}
153166
@@ -288,12 +301,22 @@ void lltdLoop (void *data){
288301 (lltd_discover_upper_header_t * )(header + 1 );
289302 uint16_t generation = ntohs (disc_header -> generation );
290303
291- log_debug ("%s: mapper_id=" ETHERNET_ADDR_FMT " ethSrc=" ETHERNET_ADDR_FMT " tos=%u xid=%u" ,
292- currentNetworkInterface -> deviceName ,
293- ETHERNET_ADDR (header -> realSource .a ),
294- ETHERNET_ADDR (header -> frameHeader .source .a ),
295- header -> tos ,
296- ntohs (header -> seqNumber ));
304+ {
305+ char mapper_id [18 ];
306+ char eth_src [18 ];
307+ snprintf (mapper_id , sizeof (mapper_id ), "%02x:%02x:%02x:%02x:%02x:%02x" ,
308+ header -> realSource .a [0 ], header -> realSource .a [1 ], header -> realSource .a [2 ],
309+ header -> realSource .a [3 ], header -> realSource .a [4 ], header -> realSource .a [5 ]);
310+ snprintf (eth_src , sizeof (eth_src ), "%02x:%02x:%02x:%02x:%02x:%02x" ,
311+ header -> frameHeader .source .a [0 ], header -> frameHeader .source .a [1 ], header -> frameHeader .source .a [2 ],
312+ header -> frameHeader .source .a [3 ], header -> frameHeader .source .a [4 ], header -> frameHeader .source .a [5 ]);
313+ log_debug ("%s: mapper_id=%s ethSrc=%s tos=%u xid=%u" ,
314+ currentNetworkInterface -> deviceName ,
315+ mapper_id ,
316+ eth_src ,
317+ header -> tos ,
318+ ntohs (header -> seqNumber ));
319+ }
297320 // Add/update session entry
298321 session_entry * entry = session_table_add (currentNetworkInterface -> sessionTable ,
299322 header -> realSource .a ,
0 commit comments