2 * Routines for OLSR (IPv4 & IPv6 compatible) RFC parsing
3 * Compatible with RFC-compliant OLSR implementations such as
4 * NRLOLSRD (http://pf.itd.nrl.navy.mil/projects/olsr/).
5 * Parser created by Aaron Woo <woo@itd.nrl.navy.mil> of
6 * the Naval Research Laboratory
7 * Currently maintained by Jeff Weston <weston@itd.nrl.navy.mil>.
9 * http://www.ietf.org/rfc/rfc3626.txt
11 * $Id: packet-olsr.c,v 1.4 2004/01/18 16:48:24 gerald Exp $
13 * Ethereal - Network traffic analyzer
14 * By Gerald Combs <gerald@ethereal.com>
15 * Copyright 1998 Gerald Combs
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40 #ifdef HAVE_SYS_TYPES_H
41 # include <sys/types.h>
44 #ifdef HAVE_NETINET_IN_H
45 # include <netinet/in.h>
50 #include <epan/packet.h>
51 #include <epan/ipv6-utils.h>
53 #define UDP_PORT_OLSR 698
59 /* Initialize the protocol and registered fields */
60 static int proto_olsr = -1;
61 static int hf_olsr_packet_len = -1;
62 static int hf_olsr_packet_seq_num = -1;
63 static int hf_olsr_message_type = -1;
64 static int hf_olsr_vtime = -1;
65 static int hf_olsr_message_size = -1;
66 static int hf_olsr_ttl = -1;
67 static int hf_olsr_hop_count = -1;
68 static int hf_olsr_message_seq_num = -1;
70 static int hf_olsr_htime = -1;
71 static int hf_olsr_willingness = -1;
73 static int hf_olsr_link_type = -1;
74 static int hf_olsr_link_message_size = -1;
75 static int hf_olsr_ansn = -1;
77 static int hf_olsr_origin_addr = -1;
78 static int hf_olsr_neighbor_addr = -1;
79 static int hf_olsr_interface_addr = -1;
80 static int hf_olsr_netmask = -1;
81 static int hf_olsr_network_addr = -1;
82 static int hf_olsr_origin6_addr = -1;
83 static int hf_olsr_neighbor6_addr = -1;
84 static int hf_olsr_interface6_addr = -1;
85 static int hf_olsr_netmask6 = -1;
86 static int hf_olsr_network6_addr = -1;
88 /* Initialize the subtree pointers*/
89 static gint ett_olsr = -1;
91 static const value_string message_type_vals[] = {
99 /*------------------------- Packet Dissecting Code-------------------------*/
101 dissect_olsr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
104 proto_tree *olsr_tree;
106 int offset, link_message_size, message_size, message_type, packet_size, position;
107 int high_bits, low_bits, vtime, htime;
113 guint32 neighbor_addr;
114 guint32 interface_addr;
115 guint32 network_addr;
117 struct e_in6_addr origin6_addr, *origin=&origin6_addr;
118 struct e_in6_addr neighbor6_addr, *neighbor=&neighbor6_addr;
119 struct e_in6_addr interface6_addr, *theinterface=&interface6_addr;
120 struct e_in6_addr network6_addr, *network=&network6_addr;
121 struct e_in6_addr netmask6, *netmask_v6=&netmask6;
124 /* Does this packet have a valid message type at the beginning? */
125 if (!tvb_bytes_exist(tvb, 0, 2))
126 return 0; /* not enough bytes for the packet length */
127 packet_len = tvb_get_ntohs(tvb, 0);
129 return 0; /* length not enough for a packet header */
130 if (packet_len > 4) {
132 * The packet claims to have more than just a packet
135 if (packet_len < 8) {
137 * ...but it doesn't claim to have enough for
138 * a full message header.
144 * OK, let's look at the type of the first message and
147 if (!tvb_bytes_exist(tvb, 4, 4))
148 return 0; /* not enough bytes for them */
149 message_type = tvb_get_guint8(tvb, 4);
150 if (match_strval(message_type, message_type_vals) == NULL)
151 return 0; /* not valid */
152 /* OK, what about the message length? */
153 message_size = tvb_get_ntohs(tvb, 4+2);
154 if (message_size < 4)
155 return 0; /* length not enough for a message header */
158 /*-------------Setting the Protocol and Info Columns in the Ethereal Display----------*/
159 if (check_col(pinfo->cinfo, COL_PROTOCOL))
160 col_set_str(pinfo->cinfo, COL_PROTOCOL, "UDP");
161 if (check_col(pinfo->cinfo, COL_INFO))
162 col_clear(pinfo->cinfo, COL_INFO);
164 if (check_col(pinfo->cinfo, COL_INFO) && (pinfo->src.type==AT_IPv4))
165 col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR (IPv4) Packet, Length: %u Bytes", packet_len);
166 else if(check_col(pinfo->cinfo, COL_INFO) && (pinfo->src.type==AT_IPv6))
167 col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR (IPv6) Packet, Length: %u Bytes", packet_len);
169 /*-----------------------------------------------------Fetching Info from IPv4 Packet and Adding to Tree-------------------------------------------*/
170 if (tree && (pinfo->src.type==AT_IPv4)) {
171 ti = proto_tree_add_item(tree, proto_olsr, tvb, 0, -1, FALSE);
172 olsr_tree = proto_item_add_subtree(ti, ett_olsr);
174 proto_tree_add_uint_format(olsr_tree, hf_olsr_packet_len, tvb, 0, 2, packet_len, "Packet Length: %u bytes", packet_len);
175 proto_tree_add_item(olsr_tree, hf_olsr_packet_seq_num, tvb, 2, 2, FALSE);
177 packet_size = (packet_len - 4) / 4;
180 while(packet_size>0) {
181 message_type = tvb_get_guint8(tvb, position);
182 proto_tree_add_uint(olsr_tree, hf_olsr_message_type, tvb, position, 1, message_type);
184 /*-------------Dissect Validity Time-------------------------*/
185 vtime = tvb_get_guint8(tvb, position+1);
186 high_bits = ((vtime & 0xF0) >> 4);
187 low_bits = (vtime & 0x0F);
188 Vtime = ((1<<low_bits)/16.0)*(1+(high_bits/16.0));
189 proto_tree_add_double_format(olsr_tree, hf_olsr_vtime, tvb, position+1, 1, Vtime, "Validity Time: %.3f (in seconds)", Vtime);
191 /*-------------Dissect Message Size---------------------------*/
192 message_size = tvb_get_ntohs(tvb, position+2);
193 if (message_size < 4) {
194 proto_tree_add_uint_format(olsr_tree, hf_olsr_message_size, tvb, position+2, 2, message_size,"Message Size: %u bytes (too short, must be >= 4)", message_size);
197 proto_tree_add_uint_format(olsr_tree, hf_olsr_message_size, tvb, position+2, 2, message_size,"Message Size: %u bytes", message_size);
200 message_size = (message_size - 4) /4;
201 offset = position + 4;
204 /*-----------------Dissecting: Origin Addr, TTL, Hop Count, and Message Seq Number*/
205 if(message_size > 0) {
206 tvb_memcpy(tvb, (guint8*)&origin_addr, offset, 4);
207 proto_tree_add_ipv4(olsr_tree, hf_olsr_origin_addr, tvb, offset, 4, origin_addr);
212 if(message_size > 0) {
213 proto_tree_add_item(olsr_tree, hf_olsr_ttl, tvb, offset, 1, FALSE);
214 proto_tree_add_item(olsr_tree, hf_olsr_hop_count, tvb, offset+1, 1, FALSE);
215 proto_tree_add_item(olsr_tree, hf_olsr_message_seq_num, tvb, offset+2, 2, FALSE);
223 /* --------------Dissecting TC message--------------------- */
224 if(message_size>0 && message_type == TC) {
225 proto_tree_add_item(olsr_tree, hf_olsr_ansn, tvb, offset, 2, FALSE);
231 while(message_size>0) {
232 tvb_memcpy(tvb, (guint8*)&neighbor_addr, offset, 4);
233 proto_tree_add_ipv4(olsr_tree, hf_olsr_neighbor_addr, tvb, offset, 4, neighbor_addr);
241 /* -------------Dissect HELLO message----------------------- */
242 else if(message_size>0 && message_type == HELLO) {
243 /*---------------------Dissect Hello Emission Invertal-------------------*/
244 htime = tvb_get_guint8(tvb, offset+2);
245 high_bits = ((htime & 0xF0) >> 4);
246 low_bits = (htime & 0x0F);
247 Htime = ((1<<low_bits)/16.0)*(1+(high_bits/16.0));
248 proto_tree_add_double_format(olsr_tree, hf_olsr_htime, tvb, offset+2, 1, Htime, "Hello Emission Interval: %.3f (in seconds)", Htime);
250 /*-------------------------Dissect Willingness---------------------------*/
251 switch(tvb_get_guint8(tvb, offset+3)) {
253 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Never");
256 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Low");
259 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Default");
262 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: High");
265 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Always");
268 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Invalid!");
270 }/* end switch Willingness */
276 while(message_size>0) {
277 /*------------------------------Dissect Link Type---------------------------------- */
278 switch(tvb_get_guint8(tvb, offset)) {
280 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Unspecified Link");
283 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Asymmetric Link");
286 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Symmetric Link");
289 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Lost Link");
292 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: MPR Link");
295 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Pending");
298 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Invalid");
300 }/* end switch Link Type */
302 /*----------------------Dissect Link Message Size--------------------------*/
303 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_message_size, tvb, offset+2, 2, tvb_get_ntohs(tvb, offset+2), "Link Message Size: %u bytes", tvb_get_ntohs(tvb, offset+2));
305 link_message_size = (tvb_get_ntohs(tvb, offset+2) - 4) / 4;
310 /*-------------------Dissect Neighbor Addresses--------------------*/
311 while(link_message_size>0) {
312 tvb_memcpy(tvb, (guint8*)&neighbor_addr, offset, 4);
313 proto_tree_add_ipv4(olsr_tree, hf_olsr_neighbor_addr, tvb, offset, 4, neighbor_addr);
321 } /* end if for Hello */
322 /*---------------------------------Dissect MID Message----------------------------------*/
323 else if(message_size>0 && message_type==MID) {
324 while(message_size>0) {
325 tvb_memcpy(tvb, (guint8*)&interface_addr, offset, 4);
326 proto_tree_add_ipv4(olsr_tree, hf_olsr_interface_addr, tvb, offset, 4, interface_addr);
330 } /* end while for MID */
332 } /* end if for MID */
333 /*-----------------------------Dissect HNA Message--------------------------------*/
334 else if(message_size>0 && message_type==HNA) {
335 while(message_size>0) {
336 tvb_memcpy(tvb, (guint8*)&network_addr, offset, 4);
337 proto_tree_add_ipv4(olsr_tree, hf_olsr_network_addr, tvb, offset, 4, network_addr);
341 tvb_memcpy(tvb, (guint8*)&netmask, offset, 4);
342 proto_tree_add_ipv4(olsr_tree, hf_olsr_netmask, tvb, offset, 4, netmask);
346 } /* end while for HNA */
348 } /* end if for HNA */
350 } /* end while for message alive */
351 } /* end if for IPV4 */
354 /*-----------------------------------------------------Fetching Info from IPv6 Packet and Adding to Tree-------------------------------------------------*/
355 if (tree && (pinfo->src.type==AT_IPv6)) {
356 ti = proto_tree_add_item(tree, proto_olsr, tvb, 0, -1, FALSE);
357 olsr_tree = proto_item_add_subtree(ti, ett_olsr);
359 proto_tree_add_uint_format(olsr_tree, hf_olsr_packet_len, tvb, 0, 2, packet_len, "Packet Length: %u bytes", packet_len);
360 proto_tree_add_item(olsr_tree, hf_olsr_packet_seq_num, tvb, 2, 2, FALSE);
363 packet_size = (packet_len - 4) / 4;
366 while(packet_size>0) {
367 message_type = tvb_get_guint8(tvb, position);
368 proto_tree_add_uint(olsr_tree, hf_olsr_message_type, tvb, position, 1, message_type);
370 /*-------------Dissect Validity Time-------------------------*/
371 vtime = tvb_get_guint8(tvb, position+1);
372 high_bits = ((vtime & 0xF0) >> 4);
373 low_bits = (vtime & 0x0F);
374 Vtime = ((1<<low_bits)/16.0)*(1.0+(high_bits/16.0));
375 proto_tree_add_double_format(olsr_tree, hf_olsr_vtime, tvb, position+1, 1, Vtime, "Validity Time: %.3f (in seconds)", Vtime);
377 /*-------------Dissect Message Size---------------------------*/
378 message_size = tvb_get_ntohs(tvb, position+2);
379 if (message_size < 4) {
380 proto_tree_add_uint_format(olsr_tree, hf_olsr_message_size, tvb, position+2, 2, message_size,"Message Size: %u bytes (too short, must be >= 4)", message_size);
383 proto_tree_add_uint_format(olsr_tree, hf_olsr_message_size, tvb, position+2, 2, message_size,"Message Size: %u bytes", message_size);
386 message_size = (message_size - 4) /4;
388 offset = position + 4;
391 /*-----------------Dissecting: Origin Addr, TTL, Hop Count, and Message Seq Number */
392 if(message_size > 0) {
393 tvb_memcpy(tvb, (guint8*)&origin6_addr, offset, 16);
394 proto_tree_add_ipv6(olsr_tree, hf_olsr_origin6_addr, tvb, offset, 16, (guint8*)origin);
399 if(message_size > 0) {
400 proto_tree_add_item(olsr_tree, hf_olsr_ttl, tvb, offset, 1, FALSE);
401 proto_tree_add_item(olsr_tree, hf_olsr_hop_count, tvb, offset+1, 1, FALSE);
402 proto_tree_add_item(olsr_tree, hf_olsr_message_seq_num, tvb, offset+2, 2, FALSE);
410 /* --------------Dissecting TC message--------------------- */
411 if(message_size>0 && message_type == TC) {
412 proto_tree_add_item(olsr_tree, hf_olsr_ansn, tvb, offset, 2, FALSE);
418 while(message_size>0) {
419 tvb_memcpy(tvb, (guint8*)&neighbor6_addr, offset, 16);
420 proto_tree_add_ipv6(olsr_tree, hf_olsr_neighbor6_addr, tvb, offset, 16, (guint8*)neighbor);
428 /* -------------Dissect HELLO message----------------------- */
429 else if(message_size>0 && message_type == HELLO) {
430 /*---------------------Dissect Hellow Emission Invertal-------------------*/
431 htime = tvb_get_guint8(tvb, offset+2);
432 high_bits = ((htime & 0xF0) >> 4);
433 low_bits = (htime & 0x0F);
434 Htime = ((1<<low_bits)/16.0)*(1.0+(high_bits/16.0));
435 proto_tree_add_double_format(olsr_tree, hf_olsr_htime, tvb, offset+2, 1, Htime, "Hello Emission Interval: %.3f (in seconds)", Htime);
437 /*---------------------Dissect Willingness----------------------------------*/
438 switch(tvb_get_guint8(tvb, offset+3)) {
440 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Never");
443 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Low");
446 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Default");
449 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: High");
452 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Always");
455 proto_tree_add_uint_format(olsr_tree, hf_olsr_willingness, tvb, offset+3, 1, tvb_get_guint8(tvb, offset+2), "Willingness: Invalid!");
457 } /* end switch for willingness */
463 while(message_size>0) {
464 /*----------------------Dissect Link Type------------------------------------*/
465 switch(tvb_get_guint8(tvb, offset)) {
467 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Unspecified Link");
470 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Asymmetric Link");
473 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Symmetric Link");
476 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Lost Link");
479 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: MPR Link");
482 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Pending");
485 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_type, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Link Type: Invalid");
487 } /* end switch Link Type */
489 /*-------------------------Dissect Link Message Size-----------------------------*/
490 proto_tree_add_uint_format(olsr_tree, hf_olsr_link_message_size, tvb, offset+2, 2, tvb_get_ntohs(tvb, offset+2), "Link Message Size: %u bytes", tvb_get_ntohs(tvb, offset+2));
492 link_message_size = (tvb_get_ntohs(tvb, offset+2) - 4) / 4;
497 /*--------------------------Dissect Neighbor Addresses---------------------------*/
498 while(link_message_size>0) {
499 tvb_memcpy(tvb, (guint8*)&neighbor6_addr, offset, 16);
500 proto_tree_add_ipv6(olsr_tree, hf_olsr_neighbor6_addr, tvb, offset, 16, (guint8*)neighbor);
504 link_message_size-=4;
508 } /* end if for Hello */
509 /*---------------------------------Dissect MID Message----------------------------------*/
510 else if(message_size>0 && message_type==MID) {
511 while(message_size>0) {
512 tvb_memcpy(tvb, (guint8*)&interface6_addr, offset, 16);
513 proto_tree_add_ipv6(olsr_tree, hf_olsr_interface6_addr, tvb, offset, 16, (guint8*)theinterface);
517 } /* end while for MID */
519 } /* end if for MID */
520 /*-----------------------------Dissect HNA Message--------------------------------*/
521 else if(message_size>0 && message_type==HNA) {
522 while(message_size>0) {
523 tvb_memcpy(tvb, (guint8*)&network6_addr, offset, 16);
524 proto_tree_add_ipv6(olsr_tree, hf_olsr_network6_addr, tvb, offset, 16, (guint8*)network);
528 tvb_memcpy(tvb, (guint8*)&netmask6, offset, 16);
529 proto_tree_add_ipv6(olsr_tree, hf_olsr_netmask6, tvb, offset, 16, (guint8*)netmask_v6);
533 } /* end while for HNA */
535 } /* end if for HNA */
536 } /* end while for message alive */
537 } /* end if for IPV6 */
538 return tvb_length(tvb);
539 } /* end Dissecting */
541 /*-----------Register the Dissector for OLSR--------------*/
543 proto_register_olsr(void)
545 static hf_register_info hf[] = {
546 { &hf_olsr_packet_len,
547 { "Packet Length", "olsr.packet_len",
548 FT_UINT16, BASE_DEC, NULL, 0,
549 "Packet Length in Bytes", HFILL }},
551 { &hf_olsr_packet_seq_num,
552 { "Packet Sequence Number", "olsr.packet_seq_num",
553 FT_UINT16, BASE_DEC, NULL, 0,
554 "Packet Sequence Number", HFILL }},
556 { &hf_olsr_message_type,
557 { "Message Type", "olsr.message_type",
558 FT_UINT8, BASE_DEC, VALS(message_type_vals), 0,
559 "Message Type", HFILL }},
561 { &hf_olsr_message_size,
562 { "Message", "olsr.message_size",
563 FT_UINT16, BASE_DEC, NULL, 0,
564 "Message Size in Bytes", HFILL }},
566 { &hf_olsr_message_seq_num,
567 { "Message Sequence Number", "olsr.message_seq_num",
568 FT_UINT16, BASE_DEC, NULL, 0,
569 "Message Sequence Number", HFILL }},
572 { "Validity Time", "olsr.vtime",
573 FT_DOUBLE, BASE_NONE, NULL, 0,
574 "Validity Time", HFILL }},
577 { "Advertised Neighbor Sequence Number (ANSN)", "olsr.ansn",
578 FT_UINT16, BASE_DEC, NULL, 0,
579 "Advertised Neighbor Sequence Number (ANSN)", HFILL }},
582 { "Hello emission interval", "olsr.htime",
583 FT_DOUBLE, BASE_NONE, NULL, 0,
584 "Hello emission interval", HFILL }},
586 { &hf_olsr_willingness,
587 { "Willingness to Carry and Forward", "olsr.willingness",
588 FT_UINT8, BASE_DEC, NULL, 0,
589 "Willingness to Carry and Forward", HFILL }},
592 { "Time to Live", "olsr.ttl",
593 FT_UINT8, BASE_DEC, NULL, 0,
594 "Time to Live", HFILL }},
596 { &hf_olsr_link_type,
597 { "Link Type", "olsr.link_type",
598 FT_UINT8, BASE_DEC, NULL, 0,
599 "Link Type", HFILL }},
601 { &hf_olsr_link_message_size,
602 { "Link Message Size", "olsr.link_message_size",
603 FT_UINT16, BASE_DEC, NULL, 0,
604 "Link Message Size", HFILL }},
606 { &hf_olsr_hop_count,
607 { "Hop Count", "olsr.hop_count",
608 FT_UINT8, BASE_DEC, NULL, 0,
609 "Hop Count", HFILL }},
611 { &hf_olsr_origin_addr,
612 { "Originator Address", "olsr.origin_addr",
613 FT_IPv4, BASE_NONE, NULL, 0,
614 "Originator Address", HFILL }},
616 { &hf_olsr_neighbor_addr,
617 { "Neighbor Address", "olsr.neighbor_addr",
618 FT_IPv4, BASE_NONE, NULL, 0,
619 "Neighbor Address", HFILL }},
622 { &hf_olsr_network_addr,
623 { "Network Address", "olsr.network_addr",
624 FT_IPv4, BASE_NONE, NULL, 0,
625 "Network Address", HFILL }},
627 { &hf_olsr_interface_addr,
628 { "Interface Address", "olsr.interface_addr",
629 FT_IPv4, BASE_NONE, NULL, 0,
630 "Interface Address", HFILL }},
633 { "Netmask", "olsr.netmask",
634 FT_IPv4, BASE_NONE, NULL, 0,
637 { &hf_olsr_origin6_addr,
638 { "Originator Address", "olsr.origin6_addr",
639 FT_IPv6, BASE_NONE, NULL, 0,
640 "Originator Address", HFILL }},
642 { &hf_olsr_neighbor6_addr,
643 { "Neighbor Address", "olsr.neighbor6_addr",
644 FT_IPv6, BASE_NONE, NULL, 0,
645 "Neighbor Address", HFILL }},
647 { &hf_olsr_network6_addr,
648 { "Network Address", "olsr.network6_addr",
649 FT_IPv6, BASE_NONE, NULL, 0,
650 "Network Address", HFILL }},
652 { &hf_olsr_interface6_addr,
653 { "Interface Address", "olsr.interface6_addr",
654 FT_IPv6, BASE_NONE, NULL, 0,
655 "Interface Address", HFILL }},
658 { "Netmask", "olsr.netmask6",
659 FT_IPv6, BASE_NONE, NULL, 0,
664 static gint *ett[] = {
669 proto_olsr = proto_register_protocol("Optimized Link State Routing Protocol",
672 proto_register_field_array(proto_olsr, hf, array_length(hf));
673 proto_register_subtree_array(ett, array_length(ett));
677 proto_reg_handoff_olsr(void)
679 dissector_handle_t olsr_handle;
681 olsr_handle = new_create_dissector_handle(dissect_olsr, proto_olsr);
682 dissector_add("udp.port", UDP_PORT_OLSR, olsr_handle);