Dump incoming and outgoing olsr frame

This commit is contained in:
Jeremy Lakeman 2012-09-07 11:50:40 +09:30
parent fba6c16eee
commit 7861658683

View File

@ -149,6 +149,11 @@ static void parse_frame(struct overlay_buffer *buff){
if (overlay_address_parse(buff, &frame.broadcast_id, NULL))
return;
frame.modifiers=ob_get(buff);
dump("received headers", buff->bytes, buff->position);
dump("received payload", buff->bytes+buff->position, buff->sizeLimit - buff->position);
// the remaining bytes are an mdp payload, process it
frame.payload = buff;
@ -233,6 +238,11 @@ int olsr_send(struct overlay_frame *frame){
ob_append_byte(b, frame->ttl);
overlay_address_append(b, frame->source);
overlay_broadcast_append(b, &frame->broadcast_id);
ob_append_byte(b, frame->modifiers);
dump("sent headers", b->bytes, b->position);
dump("sent payload", frame->payload->bytes, frame->payload->sizeLimit);
// send the packet
int ret = send_packet(b->bytes, b->position, frame->payload->bytes, frame->payload->sizeLimit);
ob_free(b);