]> git.saurik.com Git - apple/network_cmds.git/blame - tcpdump.tproj/bootp.h
network_cmds-76.tar.gz
[apple/network_cmds.git] / tcpdump.tproj / bootp.h
CommitLineData
b7080c8e
A
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License."
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24/* @(#) $Header: /cvs/Darwin/Commands/NeXT/network_cmds/tcpdump.tproj/bootp.h,v 1.1.1.1 1999/05/02 03:58:31 wsanchez Exp $ (LBL) */
25/*
26 * Bootstrap Protocol (BOOTP). RFC951 and RFC1048.
27 *
28 * This file specifies the "implementation-independent" BOOTP protocol
29 * information which is common to both client and server.
30 *
31 * Copyright 1988 by Carnegie Mellon.
32 *
33 * Permission to use, copy, modify, and distribute this program for any
34 * purpose and without fee is hereby granted, provided that this copyright
35 * and permission notice appear on all copies and supporting documentation,
36 * the name of Carnegie Mellon not be used in advertising or publicity
37 * pertaining to distribution of the program without specific prior
38 * permission, and notice be given in supporting documentation that copying
39 * and distribution is by permission of Carnegie Mellon and Stanford
40 * University. Carnegie Mellon makes no representations about the
41 * suitability of this software for any purpose. It is provided "as is"
42 * without express or implied warranty.
43 */
44
45
46struct bootp {
47 unsigned char bp_op; /* packet opcode type */
48 unsigned char bp_htype; /* hardware addr type */
49 unsigned char bp_hlen; /* hardware addr length */
50 unsigned char bp_hops; /* gateway hops */
51 u_int32_t bp_xid; /* transaction ID */
52 unsigned short bp_secs; /* seconds since boot began */
53 unsigned short bp_unused;
54 struct in_addr bp_ciaddr; /* client IP address */
55 struct in_addr bp_yiaddr; /* 'your' IP address */
56 struct in_addr bp_siaddr; /* server IP address */
57 struct in_addr bp_giaddr; /* gateway IP address */
58 unsigned char bp_chaddr[16]; /* client hardware address */
59 unsigned char bp_sname[64]; /* server host name */
60 unsigned char bp_file[128]; /* boot file name */
61 unsigned char bp_vend[64]; /* vendor-specific area */
62};
63
64/*
65 * UDP port numbers, server and client.
66 */
67#define IPPORT_BOOTPS 67
68#define IPPORT_BOOTPC 68
69
70#define BOOTREPLY 2
71#define BOOTREQUEST 1
72
73
74/*
75 * Vendor magic cookie (v_magic) for CMU
76 */
77#define VM_CMU "CMU"
78
79/*
80 * Vendor magic cookie (v_magic) for RFC1048
81 */
82#define VM_RFC1048 { 99, 130, 83, 99 }
83
84\f
85
86/*
87 * RFC1048 tag values used to specify what information is being supplied in
88 * the vendor field of the packet.
89 */
90
91#define TAG_PAD ((unsigned char) 0)
92#define TAG_SUBNET_MASK ((unsigned char) 1)
93#define TAG_TIME_OFFSET ((unsigned char) 2)
94#define TAG_GATEWAY ((unsigned char) 3)
95#define TAG_TIME_SERVER ((unsigned char) 4)
96#define TAG_NAME_SERVER ((unsigned char) 5)
97#define TAG_DOMAIN_SERVER ((unsigned char) 6)
98#define TAG_LOG_SERVER ((unsigned char) 7)
99#define TAG_COOKIE_SERVER ((unsigned char) 8)
100#define TAG_LPR_SERVER ((unsigned char) 9)
101#define TAG_IMPRESS_SERVER ((unsigned char) 10)
102#define TAG_RLP_SERVER ((unsigned char) 11)
103#define TAG_HOSTNAME ((unsigned char) 12)
104#define TAG_BOOTSIZE ((unsigned char) 13)
105#define TAG_END ((unsigned char) 255)
106/* RFC1497 tags */
107#define TAG_DUMPPATH ((unsigned char) 14)
108#define TAG_DOMAINNAME ((unsigned char) 15)
109#define TAG_SWAP_SERVER ((unsigned char) 16)
110#define TAG_ROOTPATH ((unsigned char) 17)
111#define TAG_EXTPATH ((unsigned char) 18)
112
113
114
115/*
116 * "vendor" data permitted for CMU bootp clients.
117 */
118
119struct cmu_vend {
120 unsigned char v_magic[4]; /* magic number */
121 u_int32_t v_flags; /* flags/opcodes, etc. */
122 struct in_addr v_smask; /* Subnet mask */
123 struct in_addr v_dgate; /* Default gateway */
124 struct in_addr v_dns1, v_dns2; /* Domain name servers */
125 struct in_addr v_ins1, v_ins2; /* IEN-116 name servers */
126 struct in_addr v_ts1, v_ts2; /* Time servers */
127 unsigned char v_unused[24]; /* currently unused */
128};
129
130
131/* v_flags values */
132#define VF_SMASK 1 /* Subnet mask field contains valid data */