2 * Routines for BOOTP/DHCP packet disassembly
3 * Gilbert Ramirez <gram@xiexie.org>
5 * $Id: packet-bootp.c,v 1.32 2000/05/19 02:16:17 gram Exp $
7 * The information used comes from:
8 * RFC 2132: DHCP Options and BOOTP Vendor Extensions
9 * RFC 1542: Clarifications and Extensions for the Bootstrap Protocol
10 * RFC 2131: Dynamic Host Configuration Protocol
12 * Ethereal - Network traffic analyzer
13 * By Gerald Combs <gerald@zing.org>
14 * 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.
36 #ifdef HAVE_SYS_TYPES_H
37 # include <sys/types.h>
42 #include "packet-arp.h"
44 static int proto_bootp = -1;
45 static int hf_bootp_type = -1;
46 static int hf_bootp_hw_type = -1;
47 static int hf_bootp_hw_len = -1;
48 static int hf_bootp_hops = -1;
49 static int hf_bootp_id = -1;
50 static int hf_bootp_secs = -1;
51 static int hf_bootp_flag = -1;
52 static int hf_bootp_ip_client = -1;
53 static int hf_bootp_ip_your = -1;
54 static int hf_bootp_ip_server = -1;
55 static int hf_bootp_ip_relay = -1;
56 static int hf_bootp_hw_addr = -1;
57 static int hf_bootp_server = -1;
58 static int hf_bootp_file = -1;
59 static int hf_bootp_cookie = -1;
60 static int hf_bootp_dhcp = -1;
62 static guint ett_bootp = -1;
63 static guint ett_bootp_option = -1;
65 static char * is_dhcp ;
67 #define UDP_PORT_BOOTPS 67
69 enum field_type { none, ipv4, string, toggle, yes_no, special, opaque,
71 val_u_byte, val_u_short, val_u_long,
76 enum field_type ftype;
79 #define NUM_OPT_INFOS 77
80 #define NUM_O63_SUBOPTS 11
82 /* returns the number of bytes consumed by this option */
84 bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
87 enum field_type ftype;
88 u_char code = pd[voff];
89 int vlen = pd[voff+1];
91 int i,slask,optp, consumed = vlen + 2;
93 proto_tree *v_tree,*o63_v_tree;
97 static const char *opt53_text[] = {
98 "Unknown Message Type",
108 static const value_string nbnt_vals[] = {
115 struct o63_opt_info {
121 static struct o63_opt_info o63_opt[]= {
122 /* 0 */ {"","",none},
123 /* 1 */ {"NWIP does not exist on subnet","",string},
124 /* 2 */ {"NWIP exist in options area","",string},
125 /* 3 */ {"NWIP exists in sname/file","",string},
126 /* 4 */ {"NWIP exists, but too big","",string},
127 /* 5 */ {"Broadcast for nearest Netware server","Do NOT Broadcast for nearest Netware server",yes_no},
128 /* 6 */ {"Preferred DSS server","",ipv4},
129 /* 7 */ {"Nearest NWIP server","",ipv4},
130 /* 8 */ {"Autoretries","",val_u_short},
131 /* 9 */ {"Autoretry delay, secs ","",val_u_short},
132 /* 10*/ {"Support NetWare/IP v1.1","Do NOT support NetWare/IP v1.1",yes_no},
133 /* 11*/ {"Primary DSS ", "" , special} };
136 static struct opt_info opt[] = {
137 /* 0 */ { "Padding", none },
138 /* 1 */ { "Subnet Mask", ipv4 },
139 /* 2 */ { "Time Offset", val_s_long },
140 /* 3 */ { "Router", ipv4 },
141 /* 4 */ { "Time Server", ipv4 },
142 /* 5 */ { "Name Server", ipv4 },
143 /* 6 */ { "Domain Name Server", ipv4 },
144 /* 7 */ { "Log Server", ipv4 },
145 /* 8 */ { "Cookie Server", ipv4 },
146 /* 9 */ { "LPR Server", ipv4 },
147 /* 10 */ { "Impress Server", ipv4 },
148 /* 11 */ { "Resource Location Server", ipv4 },
149 /* 12 */ { "Host Name", string },
150 /* 13 */ { "Boot File Size", val_u_short },
151 /* 14 */ { "Merit Dump File", string },
152 /* 15 */ { "Domain Name", string },
153 /* 16 */ { "Swap Server", ipv4 },
154 /* 17 */ { "Root Path", string },
155 /* 18 */ { "Extensions Path", string },
156 /* 19 */ { "IP Forwarding", toggle },
157 /* 20 */ { "Non-Local Source Routing", toggle },
158 /* 21 */ { "Policy Filter", special },
159 /* 22 */ { "Maximum Datagram Reassembly Size", val_u_short },
160 /* 23 */ { "Default IP Time-to-Live", val_u_byte },
161 /* 24 */ { "Path MTU Aging Timeout", time_in_secs },
162 /* 25 */ { "Path MTU Plateau Table", val_u_short },
163 /* 26 */ { "Interface MTU", val_u_short },
164 /* 27 */ { "All Subnets are Local", yes_no },
165 /* 28 */ { "Broadcast Address", ipv4 },
166 /* 29 */ { "Perform Mask Discovery", toggle },
167 /* 30 */ { "Mask Supplier", yes_no },
168 /* 31 */ { "Perform Router Discover", toggle },
169 /* 32 */ { "Router Solicitation Address", ipv4 },
170 /* 33 */ { "Static Route", special },
171 /* 34 */ { "Trailer Encapsulation", toggle },
172 /* 35 */ { "ARP Cache Timeout", time_in_secs },
173 /* 36 */ { "Ethernet Encapsulation", toggle },
174 /* 37 */ { "TCP Default TTL", val_u_byte },
175 /* 38 */ { "TCP Keepalive Interval", time_in_secs },
176 /* 39 */ { "TCP Keepalive Garbage", toggle },
177 /* 40 */ { "Network Information Service Domain", string },
178 /* 41 */ { "Network Information Service Servers", ipv4 },
179 /* 42 */ { "Network Time Protocol Servers", ipv4 },
180 /* 43 */ { "Vendor-Specific Information", special },
181 /* 44 */ { "NetBIOS over TCP/IP Name Server", ipv4 },
182 /* 45 */ { "NetBIOS over TCP/IP Datagram Distribution Name Server", ipv4 },
183 /* 46 */ { "NetBIOS over TCP/IP Node Type", special },
184 /* 47 */ { "NetBIOS over TCP/IP Scope", string },
185 /* 48 */ { "X Window System Font Server", ipv4 },
186 /* 49 */ { "X Window System Display Manager", ipv4 },
187 /* 50 */ { "Requested IP Address", ipv4 },
188 /* 51 */ { "IP Address Lease Time", time_in_secs },
189 /* 52 */ { "Option Overload", special },
190 /* 53 */ { "DHCP Message Type", special },
191 /* 54 */ { "Server Identifier", ipv4 },
192 /* 55 */ { "Parameter Request List", special },
193 /* 56 */ { "Message", string },
194 /* 57 */ { "Maximum DHCP Message Size", val_u_short },
195 /* 58 */ { "Renewal Time Value", time_in_secs },
196 /* 59 */ { "Rebinding Time Value", time_in_secs },
197 /* 60 */ { "Vendor class identifier", opaque },
198 /* 61 */ { "Client identifier", special },
199 /* 62 */ { "Novell/Netware IP domain", string },
200 /* 63 */ { "Novell Options", special },
201 /* 64 */ { "Network Information Service+ Domain", string },
202 /* 65 */ { "Network Information Service+ Servers", ipv4 },
203 /* 66 */ { "TFTP Server Name", string },
204 /* 67 */ { "Bootfile name", string },
205 /* 68 */ { "Mobile IP Home Agent", ipv4 },
206 /* 69 */ { "SMTP Server", ipv4 },
207 /* 70 */ { "POP3 Server", ipv4 },
208 /* 71 */ { "NNTP Server", ipv4 },
209 /* 72 */ { "Default WWW Server", ipv4 },
210 /* 73 */ { "Default Finger Server", ipv4 },
211 /* 74 */ { "Default IRC Server", ipv4 },
212 /* 75 */ { "StreetTalk Server", ipv4 },
213 /* 76 */ { "StreetTalk Directory Assistance Server", ipv4 }
216 text = opt[code].text;
221 /* check how much padding we have */
222 for (i = voff + 1; i < eoff; i++ ) {
228 proto_tree_add_text(bp_tree, NullTVB, voff, i, "Padding");
234 /* one IP address pair */
236 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
237 "Option %d: %s = %s/%s", code, text,
238 ip_to_str((guint8*)&pd[voff+2]),
239 ip_to_str((guint8*)&pd[voff+6]));
241 /* > 1 IP address pair. Let's make a sub-tree */
244 vti = proto_tree_add_text(bp_tree, NullTVB, voff,
245 consumed, "Option %d: %s", code, text);
246 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
247 for (i = voff + 2; i < voff + consumed; i += 8) {
248 proto_tree_add_text(v_tree, NullTVB, i, 8, "IP Address/Mask: %s/%s",
249 ip_to_str((guint8*)&pd[i]),
250 ip_to_str((guint8*)&pd[i+4]));
257 /* one IP address pair */
259 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
260 "Option %d: %s = %s/%s", code, text,
261 ip_to_str((guint8*)&pd[voff+2]),
262 ip_to_str((guint8*)&pd[voff+6]));
264 /* > 1 IP address pair. Let's make a sub-tree */
267 vti = proto_tree_add_text(bp_tree, NullTVB, voff,
268 consumed, "Option %d: %s", code, text);
269 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
270 for (i = voff + 2; i < voff + consumed; i += 8) {
271 proto_tree_add_text(v_tree, NullTVB, i, 8,
272 "Destination IP Address/Router: %s/%s",
273 ip_to_str((guint8*)&pd[i]),
274 ip_to_str((guint8*)&pd[i+4]));
279 /* Vendor-Specific Info */
281 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
282 "Option %d: %s", code, text);
285 /* NetBIOS-over-TCP/IP Node Type */
288 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
289 "Option %d: %s = %s", code, text,
290 val_to_str(byte, nbnt_vals,
291 "Unknown (0x%02x)"));
294 /* DHCP Message Type */
297 if (byte > 0 && byte < 9) {
303 proto_tree_add_text(bp_tree, NullTVB, voff, 3, "Option %d: %s = DHCP %s",
304 code, text, opt53_text[i]);
305 is_dhcp = (char *) opt53_text[i];
308 /* Parameter Request List */
310 vti = proto_tree_add_text(bp_tree, NullTVB, voff,
311 vlen + 2, "Option %d: %s", code, text);
312 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
313 for (i = 0; i < vlen; i++) {
315 if (byte < NUM_OPT_INFOS) {
316 proto_tree_add_text(v_tree, NullTVB, voff+2+i, 1, "%d = %s",
317 byte, opt[byte].text);
320 proto_tree_add_text(vti, NullTVB, voff+2+i, 1,
321 "Unknown Option Code: %d", byte);
326 /* Client Identifier */
328 /* We *MAY* use hwtype/hwaddr. If we have 7 bytes, I'll
329 guess that the first is the hwtype, and the last 6 are
332 vti = proto_tree_add_text(bp_tree, NullTVB, voff,
333 consumed, "Option %d: %s", code, text);
334 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
335 proto_tree_add_text(v_tree, NullTVB, voff+2, 1,
337 arphrdtype_to_str(pd[voff+2],
338 "Unknown (0x%02x)"));
339 proto_tree_add_text(v_tree, NullTVB, voff+3, 6,
340 "Client hardware address: %s",
341 arphrdaddr_to_str((guint8*)&pd[voff+3],
344 /* otherwise, it's opaque data */
346 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
347 "Option %d: %s (%d bytes)", code, text, vlen);
351 /* NetWare/IP options */
353 vti = proto_tree_add_text(bp_tree, NullTVB, voff,
354 consumed, "Option %d: %s", code, text);
355 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
359 while ( optp < (voff+consumed) ) {
360 if (pd[optp] > NUM_O63_SUBOPTS) {
361 proto_tree_add_text(v_tree, NullTVB,optp,1,"Unknown suboption %d", pd[optp]);
365 switch (o63_opt[pd[optp]].ft) {
368 proto_tree_add_text(v_tree, NullTVB, optp, 2, "Suboption %d: %s", pd[optp], o63_opt[pd[optp]].truet);
374 proto_tree_add_text(v_tree, NullTVB, optp, 3, "Suboption %d: %s", pd[optp], o63_opt[pd[optp]].truet);
376 proto_tree_add_text(v_tree, NullTVB, optp, 3, "Suboption %d: %s" , pd[optp], o63_opt[pd[optp]].falset);
382 proto_tree_add_text(v_tree, NullTVB, optp, 6,
383 "Suboption %d: %s = %s" ,
384 pd[optp], o63_opt[pd[optp]].truet,
385 ip_to_str((guint8*)&pd[optp+2]));
390 proto_tree_add_text(v_tree, NullTVB, optp, 3, "Suboption %d: %s = %d",pd[optp], o63_opt[pd[optp]].truet, pd[optp+2]);
396 if (pd[optp+1] == 4) {
397 proto_tree_add_text(v_tree, NullTVB, optp, 6,
398 "Suboption %d : %s = %s" ,
399 pd[optp], o63_opt[pd[optp]].truet,
400 ip_to_str((guint8*)&pd[optp+2]));
403 /* > 1 IP addresses. Let's make a sub-tree */
406 vti = proto_tree_add_text(v_tree, NullTVB, optp,
407 pd[optp+1]+2, "Suboption %d: %s",
408 pd[optp], o63_opt[pd[optp]].truet);
409 o63_v_tree = proto_item_add_subtree(vti, ett_bootp_option);
410 for (slask = optp + 2 ; slask < optp+pd[optp+1]; slask += 4) {
411 proto_tree_add_text(o63_v_tree, NullTVB, slask, 4, "IP Address: %s",
412 ip_to_str((guint8*)&pd[slask]));
418 proto_tree_add_text(v_tree, NullTVB,optp,1,"Unknown suboption %d", pd[optp]);
429 proto_tree_add_text(bp_tree, NullTVB, voff, 1, "End Option");
439 if (code < NUM_OPT_INFOS) {
440 text = opt[code].text;
441 ftype = opt[code].ftype;
450 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
451 "Option %d: %s = %s", code, text,
452 ip_to_str((guint8*)&pd[voff+2]));
454 /* > 1 IP addresses. Let's make a sub-tree */
457 vti = proto_tree_add_text(bp_tree, NullTVB, voff,
458 consumed, "Option %d: %s", code, text);
459 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
460 for (i = voff + 2; i < voff + consumed; i += 4) {
461 proto_tree_add_text(v_tree, NullTVB, i, 4, "IP Address: %s",
462 ip_to_str((guint8*)&pd[i]));
468 /* Fix for non null-terminated string supplied by
469 * John Lines <John.Lines@aeat.co.uk>
471 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
472 "Option %d: %s = %.*s", code, text, vlen, &pd[voff+2]);
476 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
477 "Option %d: %s (%d bytes)",
484 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
485 "Option %d: %s = %d", code, text,
486 pntohs(&pd[voff+2]));
490 vti = proto_tree_add_text(bp_tree, NullTVB, voff,
491 consumed, "Option %d: %s", code, text);
492 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
493 for (i = voff + 2; i < voff + consumed; i += 2) {
494 proto_tree_add_text(v_tree, NullTVB, i, 4, "Value: %d",
501 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
502 "Option %d: %s = %d", code, text,
503 pntohl(&pd[voff+2]));
507 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
508 "Option %d: %s = %d", code, text, pd[voff+2]);
513 if (i != 0 && i != 1) {
514 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
515 "Option %d: %s = Invalid Value %d", code, text,
519 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
520 "Option %d: %s = %s", code, text,
521 pd[voff+2] == 0 ? "Disabled" : "Enabled");
527 if (i != 0 && i != 1) {
528 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
529 "Option %d: %s = Invalid Value %d", code, text,
533 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
534 "Option %d: %s = %s", code, text,
535 pd[voff+2] == 0 ? "No" : "Yes");
540 time_secs = pntohl(&pd[voff+2]);
541 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
542 "Option %d: %s = %s", code, text,
543 ((time_secs == 0xffffffff) ?
545 time_secs_to_str(time_secs)));
549 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
550 "Option %d: %s (%d bytes)", code, text, vlen);
554 proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
555 "Unknown Option Code: %d (%d bytes)", code, vlen);
562 dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
566 int voff, eoff; /* vender offset, end offset */
571 if (check_col(fd, COL_PROTOCOL))
572 col_add_str(fd, COL_PROTOCOL, "BOOTP");
574 if (check_col(fd, COL_INFO)) {
575 if (pd[offset] == 1) {
576 col_add_fstr(fd, COL_INFO, "Boot Request from %s",
577 arphrdaddr_to_str((guint8*)&pd[offset+28],
578 pd[offset+2], pd[offset+1]));
581 col_add_str(fd, COL_INFO, "Boot Reply");
586 ti = proto_tree_add_item(tree, proto_bootp, NullTVB, offset, END_OF_FRAME, NULL);
587 bp_tree = proto_item_add_subtree(ti, ett_bootp);
589 proto_tree_add_uint_format(bp_tree, hf_bootp_type, NullTVB,
593 "Boot Request" : "Boot Reply");
594 proto_tree_add_uint_format(bp_tree, hf_bootp_hw_type, NullTVB,
598 arphrdtype_to_str(pd[offset+1],
599 "Unknown (0x%02x)"));
600 proto_tree_add_item(bp_tree, hf_bootp_hw_len, NullTVB,
601 offset + 2, 1, pd[offset+2]);
602 proto_tree_add_item(bp_tree, hf_bootp_hops, NullTVB,
603 offset + 3, 1, pd[offset+3]);
604 proto_tree_add_item(bp_tree, hf_bootp_id, NullTVB,
605 offset + 4, 4, pntohl(&pd[offset+4]));
606 proto_tree_add_item(bp_tree, hf_bootp_secs, NullTVB,
607 offset + 8, 2, pntohs(&pd[offset+8]));
608 proto_tree_add_item(bp_tree, hf_bootp_flag, NullTVB,
609 offset + 10, 2, pntohs(&pd[offset+10]) & 0x8000);
611 memcpy(&ip_addr, &pd[offset+12], sizeof(ip_addr));
612 proto_tree_add_item(bp_tree, hf_bootp_ip_client, NullTVB,
613 offset + 12, 4, ip_addr);
614 memcpy(&ip_addr, &pd[offset+16], sizeof(ip_addr));
615 proto_tree_add_item(bp_tree, hf_bootp_ip_your, NullTVB,
616 offset + 16, 4, ip_addr);
617 memcpy(&ip_addr, &pd[offset+20], sizeof(ip_addr));
618 proto_tree_add_item(bp_tree, hf_bootp_ip_server, NullTVB,
619 offset + 20, 4, ip_addr);
620 memcpy(&ip_addr, &pd[offset+24], sizeof(ip_addr));
621 proto_tree_add_item(bp_tree, hf_bootp_ip_relay, NullTVB,
622 offset + 24, 4, ip_addr);
624 proto_tree_add_bytes_format(bp_tree, hf_bootp_hw_addr, NullTVB,
625 offset + 28, pd[offset+2],
627 "Client hardware address: %s",
628 arphrdaddr_to_str((guint8*)&pd[offset+28],
629 pd[offset+2], pd[offset+1]));
631 /* The server host name is optional */
633 proto_tree_add_string_format(bp_tree, hf_bootp_server, NullTVB,
636 "Server host name: %s",
640 proto_tree_add_string_format(bp_tree, hf_bootp_server, NullTVB,
643 "Server host name not given");
647 if (pd[offset+108]) {
648 proto_tree_add_string_format(bp_tree, hf_bootp_file, NullTVB,
651 "Boot file name: %s",
655 proto_tree_add_string_format(bp_tree, hf_bootp_file, NullTVB,
658 "Boot file name not given");
661 if (pntohl(&pd[offset+236]) == 0x63825363) {
662 proto_tree_add_ipv4_format(bp_tree, hf_bootp_cookie, NullTVB,
665 "Magic cookie: (OK)");
668 memcpy(&ip_addr, &pd[offset + 236], sizeof(ip_addr));
669 proto_tree_add_item(bp_tree, hf_bootp_cookie, NullTVB,
670 offset + 236, 4, ip_addr);
674 eoff = pi.captured_len;
676 while (voff < eoff) {
677 voff += bootp_option(pd, bp_tree, voff, eoff);
679 if (is_dhcp != NULL ) {
680 if (check_col(fd, COL_PROTOCOL))
681 col_add_str(fd, COL_PROTOCOL, "DHCP");
682 if (check_col(fd, COL_INFO))
683 col_add_fstr(fd, COL_INFO, "DHCP %-8s - Trans. ID 0x%x", is_dhcp, pntohl(&pd[offset+4]) );
684 proto_tree_add_item_hidden(bp_tree, hf_bootp_dhcp, NullTVB, 0, 0, 1);
690 proto_register_bootp(void)
692 static hf_register_info hf[] = {
694 { "Frame is DHCP", "bootp.dhcp", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
698 { "Message type", "bootp.type", FT_UINT8, BASE_NONE, NULL, 0x0,
702 { "Hardware type", "bootp.hw.type", FT_UINT8, BASE_HEX, NULL, 0x0,
706 { "Hardware address length", "bootp.hw.len", FT_UINT8, BASE_DEC, NULL, 0x0,
710 { "Hops", "bootp.hops", FT_UINT8, BASE_DEC, NULL, 0x0,
714 { "Transaction ID", "bootp.id", FT_UINT32, BASE_HEX, NULL, 0x0,
718 { "Seconds elapsed", "bootp.secs", FT_UINT16, BASE_DEC, NULL, 0x0,
722 { "Broadcast flag", "bootp.flag", FT_UINT16, BASE_HEX, NULL, 0x0,
725 { &hf_bootp_ip_client,
726 { "Client IP address", "bootp.ip.client",FT_IPv4, BASE_NONE, NULL, 0x0,
730 { "Your (client) IP address", "bootp.ip.your", FT_IPv4, BASE_NONE, NULL, 0x0,
733 { &hf_bootp_ip_server,
734 { "Next server IP address", "bootp.ip.server",FT_IPv4, BASE_NONE, NULL, 0x0,
737 { &hf_bootp_ip_relay,
738 { "Relay agent IP address", "bootp.ip.relay", FT_IPv4, BASE_NONE, NULL, 0x0,
742 { "Client hardware address", "bootp.hw.addr", FT_BYTES, BASE_NONE, NULL, 0x0,
746 { "Server host name", "bootp.server", FT_STRING, BASE_NONE, NULL, 0x0,
750 { "Boot file name", "bootp.file", FT_STRING, BASE_NONE, NULL, 0x0,
754 { "Magic cookie", "bootp.cookie", FT_IPv4, BASE_NONE, NULL, 0x0,
757 static gint *ett[] = {
762 proto_bootp = proto_register_protocol("Bootstrap Protocol", "bootp");
763 proto_register_field_array(proto_bootp, hf, array_length(hf));
764 proto_register_subtree_array(ett, array_length(ett));
768 proto_reg_handoff_bootp(void)
770 dissector_add("udp.port", UDP_PORT_BOOTPS, dissect_bootp);