32#include <netinet/if_fddi.h>
33#include <net/if_llc.h>
35#if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)
39#if defined (PACKET_ASSEMBLY)
42void assemble_fddi_header (interface, buf, bufix, to)
48 struct fddi_header fh;
51 if (to && to -> hlen == 7)
52 memcpy (fh.fddi_dhost, &to -> hbuf [1],
53 sizeof (fh.fddi_dhost));
54 memcpy (fh.fddi_shost,
55 &interface -> hw_address.hbuf [1], sizeof (fh.fddi_shost));
56 fh.fddi_fc = FDDIFC_LLC_ASYNC;
57 memcpy (&buf [*bufix], &fh,
sizeof fh);
60 lh.llc_dsap = LLC_SNAP_LSAP;
61 lh.llc_ssap = LLC_SNAP_LSAP;
62 lh.llc_un.type_snap.control = LLC_UI;
64 memcpy (&buf [*bufix], &lh, LLC_SNAP_LEN);
65 *bufix += LLC_SNAP_LEN;
72ssize_t decode_fddi_header (interface, buf, bufix, from)
78 struct fddi_header fh;
82 memcpy (&from -> hbuf [1], fh.fddi_shost,
sizeof fh.fddi_shost);
83 return FDDI_HEADER_SIZE + LLC_SNAP_LEN;