~ubuntu-branches/debian/sid/isc-dhcp/sid

« back to all changes in this revision

Viewing changes to .pc/no_loopback_checksum/common/packet.c

  • Committer: Package Import Robot
  • Author(s): Andrew Pollock
  • Date: 2012-06-09 14:01:05 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120609140105-lqcz2t0rsefwzamt
Tags: 4.2.4-1
* New upstream release
* debian/control: reformatted Uploaders so that dch doesn't think I'm making
  NMUs
* debian/rules: do a clean between the LDAP-enabled build and the
  non-LDAP-enabled one, so that no LDAP-related artefacts are accidently
  incorporated into the non-LDAP build
* debian/dhclient-script.*: conditionalise the chown/chmod of the new
  resolv.conf on the existence of the old one (closes: #595400)
* debian/dhclient-script.linux: comply with RFC 3442 and ignore
  the routers option if the rfc3442-classless-static-routes option is present
  (closes: #592735)
* debian/dhclient-script.kfreebsd: fix subnet mask handling (closes: #677985)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
   Packet assembly code, originally contributed by Archie Cobbs. */
4
4
 
5
5
/*
6
 
 * Copyright (c) 2004,2005,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
 
6
 * Copyright (c) 2009,2012 by Internet Systems Consortium, Inc. ("ISC")
 
7
 * Copyright (c) 2004,2005,2007 by Internet Systems Consortium, Inc. ("ISC")
7
8
 * Copyright (c) 1996-2003 by Internet Software Consortium
8
9
 *
9
10
 * Permission to use, copy, modify, and distribute this software for any
105
106
        unsigned *bufix;
106
107
        struct hardware *to;
107
108
{
108
 
#if defined (HAVE_TR_SUPPORT)
109
 
        if (interface -> hw_address.hbuf [0] == HTYPE_IEEE802)
110
 
                assemble_tr_header (interface, buf, bufix, to);
111
 
        else
 
109
        switch (interface->hw_address.hbuf[0]) {
 
110
#if defined(HAVE_TR_SUPPORT)
 
111
        case HTYPE_IEEE802:
 
112
                assemble_tr_header(interface, buf, bufix, to);
 
113
                break;
112
114
#endif
113
115
#if defined (DEC_FDDI)
114
 
             if (interface -> hw_address.hbuf [0] == HTYPE_FDDI)
115
 
                     assemble_fddi_header (interface, buf, bufix, to);
116
 
        else
 
116
        case HTYPE_FDDI:
 
117
                assemble_fddi_header(interface, buf, bufix, to);
 
118
                break;
117
119
#endif
118
 
                assemble_ethernet_header (interface, buf, bufix, to);
119
 
 
 
120
        case HTYPE_INFINIBAND:
 
121
                log_error("Attempt to assemble hw header for infiniband");
 
122
                break;
 
123
        case HTYPE_ETHER:
 
124
        default:
 
125
                assemble_ethernet_header(interface, buf, bufix, to);
 
126
                break;
 
127
        }
120
128
}
121
129
 
122
130
/* UDP header and IP header assembled together for convenience. */
184
192
 
185
193
#ifdef PACKET_DECODING
186
194
/* Decode a hardware header... */
187
 
/* XXX currently only supports ethernet; doesn't check for other types. */
 
195
/* Support for ethernet, TR and FDDI
 
196
 * Doesn't support infiniband yet as the supported oses shouldn't get here
 
197
 */
188
198
 
189
199
ssize_t decode_hw_header (interface, buf, bufix, from)
190
200
     struct interface_info *interface;
192
202
     unsigned bufix;
193
203
     struct hardware *from;
194
204
{
 
205
        switch(interface->hw_address.hbuf[0]) {
195
206
#if defined (HAVE_TR_SUPPORT)
196
 
        if (interface -> hw_address.hbuf [0] == HTYPE_IEEE802)
197
 
                return decode_tr_header (interface, buf, bufix, from);
198
 
        else
 
207
        case HTYPE_IEEE802:
 
208
                return (decode_tr_header(interface, buf, bufix, from));
199
209
#endif
200
210
#if defined (DEC_FDDI)
201
 
             if (interface -> hw_address.hbuf [0] == HTYPE_FDDI)
202
 
                     return decode_fddi_header (interface, buf, bufix, from);
203
 
        else
 
211
        case HTYPE_FDDI:
 
212
                return (decode_fddi_header(interface, buf, bufix, from));
204
213
#endif
205
 
                return decode_ethernet_header (interface, buf, bufix, from);
 
214
        case HTYPE_INFINIBAND:
 
215
                log_error("Attempt to decode hw header for infiniband");
 
216
                return (0);
 
217
        case HTYPE_ETHER:
 
218
        default:
 
219
                return (decode_ethernet_header(interface, buf, bufix, from));
 
220
        }
206
221
}
207
222
 
208
223
/* UDP header and IP header decoded together for convenience. */