3 * $Id: packet-mip6.c,v 1.4 2003/07/11 21:03:13 guy Exp $
5 * Routines for Mobile IPv6 dissection (draft-ietf-mobileip-ipv6-20.txt)
6 * Copyright 2003 Oy L M Ericsson Ab <teemu.rinta-aho@ericsson.fi>
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@ethereal.com>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include <epan/packet.h>
35 #include "packet-mip6.h"
37 /* Initialize the protocol and registered header fields */
38 static int proto_mip6 = -1;
39 static int hf_mip6_proto = -1;
40 static int hf_mip6_hlen = -1;
41 static int hf_mip6_mhtype = -1;
42 static int hf_mip6_reserved = -1;
43 static int hf_mip6_csum = -1;
45 static int hf_mip6_hoti_cookie = -1;
47 static int hf_mip6_coti_cookie = -1;
49 static int hf_mip6_hot_nindex = -1;
50 static int hf_mip6_hot_cookie = -1;
51 static int hf_mip6_hot_token = -1;
53 static int hf_mip6_cot_nindex = -1;
54 static int hf_mip6_cot_cookie = -1;
55 static int hf_mip6_cot_token = -1;
57 static int hf_mip6_bu_seqnr = -1;
58 static int hf_mip6_bu_a_flag = -1;
59 static int hf_mip6_bu_h_flag = -1;
60 static int hf_mip6_bu_l_flag = -1;
61 static int hf_mip6_bu_k_flag = -1;
62 static int hf_mip6_bu_lifetime = -1;
64 static int hf_mip6_ba_status = -1;
65 static int hf_mip6_ba_k_flag = -1;
66 static int hf_mip6_ba_seqnr = -1;
67 static int hf_mip6_ba_lifetime = -1;
69 static int hf_mip6_be_status = -1;
70 static int hf_mip6_be_haddr = -1;
72 static int hf_mip6_bra_interval = -1;
74 static int hf_mip6_acoa_acoa = -1;
76 static int hf_mip6_ni_hni = -1;
77 static int hf_mip6_ni_cni = -1;
79 static int hf_mip6_bad_auth = -1;
81 /* Initialize the subtree pointers */
82 static gint ett_mip6 = -1;
83 static gint ett_mip6_opt_padn = -1;
84 static gint ett_mip6_opt_bra = -1;
85 static gint ett_mip6_opt_acoa = -1;
86 static gint ett_mip6_opt_ni = -1;
87 static gint ett_mip6_opt_bad = -1;
89 /* Functions to dissect the mobility headers */
92 dissect_mip6_brr(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo)
94 proto_tree *data_tree = NULL;
97 if (check_col(pinfo->cinfo, COL_INFO))
98 col_set_str(pinfo->cinfo, COL_INFO, "Binding Refresh Request");
101 ti = proto_tree_add_text(mip6_tree, tvb, MIP6_DATA_OFF,
102 MIP6_BRR_LEN, "Binding Refresh Request");
103 data_tree = proto_item_add_subtree(ti, ett_mip6);
106 return MIP6_DATA_OFF+MIP6_BRR_LEN;
110 dissect_mip6_hoti(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo)
112 proto_tree *data_tree = NULL;
115 if (check_col(pinfo->cinfo, COL_INFO))
116 col_set_str(pinfo->cinfo, COL_INFO, "Home Test Init");
119 ti = proto_tree_add_text(mip6_tree, tvb, MIP6_DATA_OFF,
120 MIP6_HOTI_LEN, "Home Test Init");
121 data_tree = proto_item_add_subtree(ti, ett_mip6);
123 proto_tree_add_item(data_tree, hf_mip6_hoti_cookie, tvb,
124 MIP6_HOTI_COOKIE_OFF, MIP6_HOTI_COOKIE_LEN, FALSE);
127 return MIP6_DATA_OFF+MIP6_HOTI_LEN;
131 dissect_mip6_coti(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo)
133 proto_tree *data_tree = NULL;
136 if (check_col(pinfo->cinfo, COL_INFO))
137 col_set_str(pinfo->cinfo, COL_INFO, "Care-of Test Init");
140 ti = proto_tree_add_text(mip6_tree, tvb, MIP6_DATA_OFF,
141 MIP6_COTI_LEN, "Care-of Test Init");
142 data_tree = proto_item_add_subtree(ti, ett_mip6);
144 proto_tree_add_item(data_tree, hf_mip6_coti_cookie, tvb,
145 MIP6_COTI_COOKIE_OFF, MIP6_COTI_COOKIE_LEN, FALSE);
148 return MIP6_DATA_OFF+MIP6_COTI_LEN;
152 dissect_mip6_hot(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo)
154 proto_tree *data_tree = NULL;
157 if (check_col(pinfo->cinfo, COL_INFO))
158 col_set_str(pinfo->cinfo, COL_INFO, "Home Test");
161 ti = proto_tree_add_text(mip6_tree, tvb, MIP6_DATA_OFF,
162 MIP6_HOT_LEN, "Home Test");
163 data_tree = proto_item_add_subtree(ti, ett_mip6);
165 proto_tree_add_item(data_tree, hf_mip6_hot_nindex, tvb,
166 MIP6_HOT_INDEX_OFF, MIP6_HOT_INDEX_LEN, FALSE);
167 proto_tree_add_item(data_tree, hf_mip6_hot_cookie, tvb,
168 MIP6_HOT_COOKIE_OFF, MIP6_HOT_COOKIE_LEN, FALSE);
169 proto_tree_add_item(data_tree, hf_mip6_hot_token, tvb,
170 MIP6_HOT_TOKEN_OFF, MIP6_HOT_TOKEN_LEN, FALSE);
173 return MIP6_DATA_OFF+MIP6_HOT_LEN;
177 dissect_mip6_cot(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo)
179 proto_tree *data_tree = NULL;
182 if (check_col(pinfo->cinfo, COL_INFO))
183 col_set_str(pinfo->cinfo, COL_INFO, "Care-of Test");
186 ti = proto_tree_add_text(mip6_tree, tvb, MIP6_DATA_OFF,
187 MIP6_COT_LEN, "Care-of Test");
188 data_tree = proto_item_add_subtree(ti, ett_mip6);
190 proto_tree_add_item(data_tree, hf_mip6_cot_nindex, tvb,
191 MIP6_COT_INDEX_OFF, MIP6_COT_INDEX_LEN, FALSE);
192 proto_tree_add_item(data_tree, hf_mip6_cot_cookie, tvb,
193 MIP6_COT_COOKIE_OFF, MIP6_COT_COOKIE_LEN, FALSE);
194 proto_tree_add_item(data_tree, hf_mip6_hot_token, tvb,
195 MIP6_COT_TOKEN_OFF, MIP6_COT_TOKEN_LEN, FALSE);
198 return MIP6_DATA_OFF+MIP6_COT_LEN;
202 dissect_mip6_bu(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo)
204 proto_tree *data_tree = NULL;
208 if (check_col(pinfo->cinfo, COL_INFO))
209 col_set_str(pinfo->cinfo, COL_INFO, "Binding Update");
212 ti = proto_tree_add_text(mip6_tree, tvb, MIP6_DATA_OFF,
213 MIP6_BU_LEN, "Binding Update");
214 data_tree = proto_item_add_subtree(ti, ett_mip6);
216 proto_tree_add_item(data_tree, hf_mip6_bu_seqnr, tvb,
217 MIP6_BU_SEQNR_OFF, MIP6_BU_SEQNR_LEN, FALSE);
219 proto_tree_add_item(data_tree, hf_mip6_bu_a_flag, tvb,
220 MIP6_BU_FLAGS_OFF, MIP6_BU_FLAGS_LEN, FALSE);
221 proto_tree_add_item(data_tree, hf_mip6_bu_h_flag, tvb,
222 MIP6_BU_FLAGS_OFF, MIP6_BU_FLAGS_LEN, FALSE);
223 proto_tree_add_item(data_tree, hf_mip6_bu_l_flag, tvb,
224 MIP6_BU_FLAGS_OFF, MIP6_BU_FLAGS_LEN, FALSE);
225 proto_tree_add_item(data_tree, hf_mip6_bu_k_flag, tvb,
226 MIP6_BU_FLAGS_OFF, MIP6_BU_FLAGS_LEN, FALSE);
228 lifetime = tvb_get_ntohs(tvb, MIP6_BU_LIFETIME_OFF);
229 proto_tree_add_uint_format(data_tree, hf_mip6_bu_lifetime, tvb,
230 MIP6_BU_LIFETIME_OFF,
231 MIP6_BU_LIFETIME_LEN, lifetime,
232 "Lifetime: %d (%ld seconds)",
233 lifetime, (long)lifetime * 4);
236 return MIP6_DATA_OFF+MIP6_BU_LEN;
240 dissect_mip6_ba(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo)
242 proto_tree *data_tree = NULL;
246 if (check_col(pinfo->cinfo, COL_INFO))
247 col_set_str(pinfo->cinfo, COL_INFO, "Binding Acknowledgement");
250 ti = proto_tree_add_text(mip6_tree, tvb, MIP6_DATA_OFF,
251 MIP6_BA_LEN, "Binding Acknowledgement");
252 data_tree = proto_item_add_subtree(ti, ett_mip6);
254 proto_tree_add_item(data_tree, hf_mip6_ba_status, tvb,
255 MIP6_BA_STATUS_OFF, MIP6_BA_STATUS_LEN, FALSE);
256 proto_tree_add_item(data_tree, hf_mip6_ba_k_flag, tvb,
257 MIP6_BA_FLAGS_OFF, MIP6_BA_FLAGS_LEN, FALSE);
258 proto_tree_add_item(data_tree, hf_mip6_ba_seqnr, tvb,
259 MIP6_BA_SEQNR_OFF, MIP6_BA_SEQNR_LEN, FALSE);
260 lifetime = tvb_get_ntohs(tvb, MIP6_BA_LIFETIME_OFF);
261 proto_tree_add_uint_format(data_tree, hf_mip6_ba_lifetime, tvb,
262 MIP6_BA_LIFETIME_OFF,
263 MIP6_BA_LIFETIME_LEN, lifetime,
264 "Lifetime: %d (%ld seconds)",
265 lifetime, (long)lifetime * 4);
268 return MIP6_DATA_OFF+MIP6_BA_LEN;
272 dissect_mip6_be(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo)
274 proto_tree *data_tree = NULL;
277 if (check_col(pinfo->cinfo, COL_INFO))
278 col_set_str(pinfo->cinfo, COL_INFO, "Binding Error");
281 ti = proto_tree_add_text(mip6_tree, tvb, MIP6_DATA_OFF,
282 MIP6_BE_LEN, "Binding Error");
283 data_tree = proto_item_add_subtree(ti, ett_mip6);
285 proto_tree_add_item(data_tree, hf_mip6_be_status, tvb,
286 MIP6_BE_STATUS_OFF, MIP6_BE_STATUS_LEN, FALSE);
287 proto_tree_add_item(data_tree, hf_mip6_be_haddr, tvb,
288 MIP6_BE_HOA_OFF, MIP6_BE_HOA_LEN, FALSE);
291 return MIP6_DATA_OFF+MIP6_BE_LEN;
295 dissect_mip6_unknown(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo)
297 proto_tree *data_tree = NULL;
300 if (check_col(pinfo->cinfo, COL_INFO))
301 col_set_str(pinfo->cinfo, COL_INFO, "Unknown MH Type");
304 ti = proto_tree_add_text(mip6_tree, tvb, MIP6_DATA_OFF,
305 MIP6_DATA_OFF+1, "Unknown MH Type");
306 data_tree = proto_item_add_subtree(ti, ett_mip6);
309 return MIP6_DATA_OFF+1;
312 /* Functions to dissect the mobility options */
315 dissect_mip6_opt_padn(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset,
316 guint optlen, packet_info *pinfo _U_,
317 proto_tree *opt_tree)
319 proto_tree_add_text(opt_tree, tvb, offset, optlen,
320 "%s: %u bytes", optp->name, optlen);
324 dissect_mip6_opt_bra(const ip_tcp_opt *optp _U_, tvbuff_t *tvb, int offset,
325 guint optlen, packet_info *pinfo _U_,
326 proto_tree *opt_tree)
330 ri = tvb_get_ntohs(tvb, offset + MIP6_BRA_RI_OFF);
331 proto_tree_add_uint_format(opt_tree, hf_mip6_bra_interval, tvb,
333 ri, "Refresh interval: %d (%ld seconds)",
338 dissect_mip6_opt_acoa(const ip_tcp_opt *optp _U_, tvbuff_t *tvb, int offset,
339 guint optlen, packet_info *pinfo _U_,
340 proto_tree *opt_tree)
342 proto_tree_add_ipv6(opt_tree, hf_mip6_acoa_acoa, tvb,
344 tvb_get_ptr(tvb, offset + MIP6_ACOA_ACOA_OFF, MIP6_ACOA_ACOA_LEN));
348 dissect_mip6_opt_ni(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset,
349 guint optlen, packet_info *pinfo _U_,
350 proto_tree *opt_tree)
352 proto_tree *field_tree = NULL;
355 tf = proto_tree_add_text(opt_tree, tvb, offset, optlen, "%s", optp->name);
356 field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
358 proto_tree_add_item(field_tree, hf_mip6_ni_hni, tvb,
359 offset + MIP6_NI_HNI_OFF, MIP6_NI_HNI_LEN, FALSE);
360 proto_tree_add_item(field_tree, hf_mip6_ni_cni, tvb,
361 offset + MIP6_NI_CNI_OFF, MIP6_NI_CNI_LEN, FALSE);
365 dissect_mip6_opt_bad(const ip_tcp_opt *optp _U_, tvbuff_t *tvb, int offset,
366 guint optlen, packet_info *pinfo _U_,
367 proto_tree *opt_tree)
369 proto_tree *field_tree = NULL;
372 tf = proto_tree_add_text(opt_tree, tvb, offset, optlen, "%s", optp->name);
373 field_tree = proto_item_add_subtree(tf, *optp->subtree_index);
375 proto_tree_add_item(field_tree, hf_mip6_bad_auth, tvb,
376 offset + MIP6_BAD_AUTH_OFF,
377 optlen - MIP6_BAD_AUTH_OFF, FALSE);
380 static const ip_tcp_opt mip6_opts[] = {
395 dissect_mip6_opt_padn
399 "Binding Refresh Advice",
407 "Alternate Care-of Address",
411 dissect_mip6_opt_acoa
423 "Binding Authorization Data",
431 #define N_MIP6_OPTS (sizeof mip6_opts / sizeof mip6_opts[0])
433 /* Function to dissect mobility options */
435 dissect_mip6_options(tvbuff_t *tvb, proto_tree *mip6_tree, int offset, int len,
438 proto_tree *opts_tree = NULL;
444 ti = proto_tree_add_text(mip6_tree, tvb, offset, len - offset,
446 opts_tree = proto_item_add_subtree(ti, ett_mip6);
448 dissect_ipv6_options(tvb, offset, len,
449 mip6_opts, N_MIP6_OPTS, -1, pinfo, opts_tree);
454 /* Function that dissects the whole MIPv6 packet */
456 dissect_mip6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
458 proto_tree *mip6_tree = NULL;
461 guint len, offset = 0, start_offset = offset;
463 /* Make entries in Protocol column and Info column on summary display */
464 if (check_col(pinfo->cinfo, COL_PROTOCOL))
465 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MIPv6");
466 if (check_col(pinfo->cinfo, COL_INFO))
467 col_clear(pinfo->cinfo, COL_INFO);
469 len = (tvb_get_guint8(tvb, MIP6_HLEN_OFF) + 1) * 8;
471 ti = proto_tree_add_item(tree, proto_mip6, tvb, 0, len, FALSE);
472 mip6_tree = proto_item_add_subtree(ti, ett_mip6);
474 /* Process header fields */
475 proto_tree_add_uint_format(mip6_tree, hf_mip6_proto, tvb,
477 tvb_get_guint8(tvb, MIP6_PROTO_OFF),
478 "Payload protocol: %s (0x%02x)",
480 tvb_get_guint8(tvb, MIP6_PROTO_OFF)),
481 tvb_get_guint8(tvb, MIP6_PROTO_OFF));
483 proto_tree_add_uint_format(mip6_tree, hf_mip6_hlen, tvb,
485 tvb_get_guint8(tvb, MIP6_HLEN_OFF),
486 "Header length: %u (%u bytes)",
487 tvb_get_guint8(tvb, MIP6_HLEN_OFF),
490 proto_tree_add_item(mip6_tree, hf_mip6_mhtype, tvb,
491 MIP6_TYPE_OFF, 1, FALSE);
493 proto_tree_add_item(mip6_tree, hf_mip6_reserved, tvb,
494 MIP6_RES_OFF, 1, FALSE);
496 proto_tree_add_item(mip6_tree, hf_mip6_csum, tvb,
497 MIP6_CSUM_OFF, 2, FALSE);
500 /* Process mobility header */
501 type = tvb_get_guint8(tvb, MIP6_TYPE_OFF);
504 offset = dissect_mip6_brr(tvb, mip6_tree, pinfo);
507 offset = dissect_mip6_hoti(tvb, mip6_tree, pinfo);
510 offset = dissect_mip6_coti(tvb, mip6_tree, pinfo);
513 offset = dissect_mip6_hot(tvb, mip6_tree, pinfo);
516 offset = dissect_mip6_cot(tvb, mip6_tree, pinfo);
519 offset = dissect_mip6_bu(tvb, mip6_tree, pinfo);
522 offset = dissect_mip6_ba(tvb, mip6_tree, pinfo);
525 offset = dissect_mip6_be(tvb, mip6_tree, pinfo);
528 dissect_mip6_unknown(tvb, mip6_tree, pinfo);
533 /* Process mobility options */
535 if (len < (offset - start_offset)) {
536 proto_tree_add_text(tree, tvb, 0, 0, "Bogus header length");
539 len -= (offset - start_offset);
540 dissect_mip6_options(tvb, mip6_tree, offset, len, pinfo);
544 /* Register the protocol with Ethereal */
546 proto_register_mip6(void)
548 /* Setup list of header fields */
549 static hf_register_info hf[] = {
551 { &hf_mip6_proto, { "Payload protocol", "mip6.proto",
552 FT_UINT8, BASE_DEC, NULL, 0,
553 "Payload protocol", HFILL }},
554 { &hf_mip6_hlen, { "Header length", "mip6.hlen",
555 FT_UINT8, BASE_DEC, NULL, 0,
556 "Header length", HFILL }},
557 { &hf_mip6_mhtype, { "Mobility Header Type", "mip6.mhtype",
558 FT_UINT8, BASE_DEC, VALS(mip6_mh_types), 0,
559 "Mobility Header Type", HFILL }},
560 { &hf_mip6_reserved, { "Reserved", "mip6.reserved",
561 FT_UINT8, BASE_HEX, NULL, 0,
562 "Reserved", HFILL }},
563 { &hf_mip6_csum, { "Checksum", "mip6.csum",
564 FT_UINT16, BASE_HEX, NULL, 0,
565 "Header Checksum", HFILL }},
567 { &hf_mip6_hoti_cookie, { "Home Init Cookie", "mip6.hoti.cookie",
568 FT_UINT64, BASE_HEX, NULL, 0,
569 "Home Init Cookie", HFILL }},
571 { &hf_mip6_coti_cookie, { "Care-of Init Cookie", "mip6.coti.cookie",
572 FT_UINT64, BASE_HEX, NULL, 0,
573 "Care-of Init Cookie", HFILL }},
575 { &hf_mip6_hot_nindex, { "Home Nonce Index", "mip6.hot.nindex",
576 FT_UINT16, BASE_DEC, NULL, 0,
577 "Home Nonce Index", HFILL }},
578 { &hf_mip6_hot_cookie, { "Home Init Cookie", "mip6.hot.cookie",
579 FT_UINT64, BASE_HEX, NULL, 0,
580 "Home Init Cookie", HFILL }},
581 { &hf_mip6_hot_token, { "Home Keygen Token", "mip6.hot.token",
582 FT_UINT64, BASE_HEX, NULL, 0,
583 "Home Keygen Token", HFILL }},
585 { &hf_mip6_cot_nindex, { "Care-of Nonce Index", "mip6.cot.nindex",
586 FT_UINT16, BASE_DEC, NULL, 0,
587 "Care-of Nonce Index", HFILL }},
588 { &hf_mip6_cot_cookie, { "Care-of Init Cookie", "mip6.cot.cookie",
589 FT_UINT64, BASE_HEX, NULL, 0,
590 "Care-of Init Cookie", HFILL }},
591 { &hf_mip6_cot_token, { "Care-of Keygen Token", "mip6.cot.token",
592 FT_UINT64, BASE_HEX, NULL, 0,
593 "Care-of Keygen Token", HFILL }},
595 { &hf_mip6_bu_seqnr, { "Sequence number", "mip6.bu.seqnr",
596 FT_UINT16, BASE_DEC, NULL, 0,
597 "Sequence number", HFILL }},
598 { &hf_mip6_bu_a_flag, { "Acknowledge (A) flag", "mip6.bu.a_flag",
599 FT_BOOLEAN, 8, TFS(&mip6_bu_a_flag_value),
600 0x80, "Acknowledge (A) flag", HFILL }},
601 { &hf_mip6_bu_h_flag, { "Home Registration (H) flag",
603 FT_BOOLEAN, 8, TFS(&mip6_bu_h_flag_value),
604 0x40, "Home Registration (H) flag", HFILL }},
605 { &hf_mip6_bu_l_flag, { "Link-Local Compatibility (L) flag",
607 FT_BOOLEAN, 8, TFS(&mip6_bu_l_flag_value),
608 0x20, "Home Registration (H) flag", HFILL }},
609 { &hf_mip6_bu_k_flag, { "Key Management Compatibility (K) flag",
611 FT_BOOLEAN, 8, TFS(&mip6_bu_k_flag_value),
612 0x10, "Key Management Compatibility (K) flag",
614 { &hf_mip6_bu_lifetime, { "Lifetime", "mip6.bu.lifetime",
615 FT_UINT16, BASE_DEC, NULL, 0,
616 "Lifetime", HFILL }},
618 { &hf_mip6_ba_status, { "Status", "mip6.ba.status",
620 VALS(&mip6_ba_status_value), 0,
621 "Binding Acknowledgement status", HFILL }},
622 { &hf_mip6_ba_k_flag, { "Key Management Compatibility (K) flag",
624 FT_BOOLEAN, 8, TFS(&mip6_bu_k_flag_value),
625 0x80, "Key Management Compatibility (K) flag",
627 { &hf_mip6_ba_seqnr, { "Sequence number", "mip6.ba.seqnr",
628 FT_UINT16, BASE_DEC, NULL, 0,
629 "Sequence number", HFILL }},
630 { &hf_mip6_ba_lifetime, { "Lifetime", "mip6.ba.lifetime",
631 FT_UINT16, BASE_DEC, NULL, 0,
632 "Lifetime", HFILL }},
634 { &hf_mip6_be_status, { "Status", "mip6.be.status",
636 VALS(&mip6_be_status_value), 0,
637 "Binding Error status", HFILL }},
638 { &hf_mip6_be_haddr, { "Home Address", "mip6.be.haddr",
639 FT_IPv6, BASE_HEX, NULL, 0,
640 "Home Address", HFILL }},
642 { &hf_mip6_bra_interval, { "Refresh interval", "mip6.bra.interval",
643 FT_UINT16, BASE_DEC, NULL, 0,
644 "Refresh interval", HFILL }},
646 { &hf_mip6_acoa_acoa, { "Alternate care-of address", "mip6.acoa.acoa",
647 FT_IPv6, BASE_HEX, NULL, 0,
648 "Alternate Care-of address", HFILL }},
650 { &hf_mip6_ni_hni, { "Home nonce index", "mip6.ni.hni",
651 FT_UINT16, BASE_DEC, NULL, 0,
652 "Home nonce index", HFILL }},
653 { &hf_mip6_ni_cni, { "Care-of nonce index", "mip6.ni.cni",
654 FT_UINT16, BASE_DEC, NULL, 0,
655 "Care-of nonce index", HFILL }},
657 { &hf_mip6_bad_auth, { "Authenticator", "mip6.bad.auth",
658 FT_BYTES, BASE_HEX, NULL, 0,
659 "Care-of nonce index", HFILL }}
662 /* Setup protocol subtree array */
663 static gint *ett[] = {
672 /* Register the protocol name and description */
673 proto_mip6 = proto_register_protocol("Mobile IPv6", "MIPv6", "mipv6");
675 /* Register the dissector by name */
676 /* register_dissector("mipv6", dissect_mip6, proto_mip6); */
678 /* Required function calls to register the header fields and subtrees used */
679 proto_register_field_array(proto_mip6, hf, array_length(hf));
680 proto_register_subtree_array(ett, array_length(ett));
684 proto_reg_handoff_mip6(void)
686 dissector_handle_t mip6_handle;
688 /* mip6_handle = find_dissector("mipv6"); */
689 mip6_handle = create_dissector_handle(dissect_mip6, proto_mip6);
690 dissector_add("ip.proto", IP_PROTO_MIPV6, mip6_handle);