00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "dhcpd.h"
00030
00031 #if defined (DEC_FDDI)
00032 #include <netinet/if_fddi.h>
00033 #include <net/if_llc.h>
00034
00035 #if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)
00036 #include "includes/netinet/if_ether.h"
00037 #endif
00038
00039 #if defined (PACKET_ASSEMBLY)
00040
00041
00042 void assemble_fddi_header (interface, buf, bufix, to)
00043 struct interface_info *interface;
00044 unsigned char *buf;
00045 unsigned *bufix;
00046 struct hardware *to;
00047 {
00048 struct fddi_header fh;
00049 struct llc lh;
00050
00051 if (to && to -> hlen == 7)
00052 memcpy (fh.fddi_dhost, &to -> hbuf [1],
00053 sizeof (fh.fddi_dhost));
00054 memcpy (fh.fddi_shost,
00055 &interface -> hw_address.hbuf [1], sizeof (fh.fddi_shost));
00056 fh.fddi_fc = FDDIFC_LLC_ASYNC;
00057 memcpy (&buf [*bufix], &fh, sizeof fh);
00058 *bufix += sizeof fh;
00059
00060 lh.llc_dsap = LLC_SNAP_LSAP;
00061 lh.llc_ssap = LLC_SNAP_LSAP;
00062 lh.llc_un.type_snap.control = LLC_UI;
00063 lh.llc_un.type_snap.ether_type = htons (ETHERTYPE_IP);
00064 memcpy (&buf [*bufix], &lh, LLC_SNAP_LEN);
00065 *bufix += LLC_SNAP_LEN;
00066 }
00067 #endif
00068
00069 #ifdef PACKET_DECODING
00070
00071
00072 ssize_t decode_fddi_header (interface, buf, bufix, from)
00073 struct interface_info *interface;
00074 unsigned char *buf;
00075 unsigned bufix;
00076 struct hardware *from;
00077 {
00078 struct fddi_header fh;
00079 struct llc lh;
00080
00081 from -> hbuf [0] = HTYPE_FDDI;
00082 memcpy (&from -> hbuf [1], fh.fddi_shost, sizeof fh.fddi_shost);
00083 return FDDI_HEADER_SIZE + LLC_SNAP_LEN;
00084 }
00085 #endif
00086 #endif