ftp.nice.ch/pub/next/developer/resources/libraries/eni.a.tar.gz#/doc/eni_get_packet.man

This is eni_get_packet.man in view mode; [Download] [Up]

.\" @(#)eni_get_packet.l 1.0 22Sep91 McGill SOCS
.TH ENI_GET_PACKET L "22 September 1991"
.SH NAME
eni_get_packet \- receive a packet from the Ethernet front\-end
.SH SYNOPSIS
.nf
.B "#include <libeni.h>
.PP
.B int eni_get_packet(packet, dlen)
.B unsigned char *packet ;
.B int *dlen ;
.fi
.SH DESCRIPTION
.I eni_get_packet
blocks until a packet is received from the front\-end to the Ethernet device
driver.  The contents of the packet are placed in the buffer pointed to by
.I packet,
which must be at least
.B ENI_PACKET_SIZE
bytes in size.  The number of bytes of data contained in the packet is placed
in the variable
.I dlen.
(See the
.B BUGS
section.)
.PP
It should also be noted that the non\-data portions of the packet (the
source address, destination address and the frame type) will be in network
byte order, which places the most significant byte at the lowest address.
.SH "RETURN VALUES"
.I eni_get_packet
returns 0 if it is successful, otherwise it returns -1.  In the latter case
the external variable
.I eni_errno
is set to one of the following values:
.TP 15
[ENOINIT]
.B eni_init
has not been called, or was unsuccessful.
.TP 15
[ENXIO]
error talking to the loadable kernel server.
.SH BUGS
The current Ethernet protocol (IEEE 802.3) requires that an Ethernet frame be
at least 64 bytes in length (including checksum).  This means that a
packet will be padded if it contains less than 46 bytes of data.
Therefore, a packet sent with a small amount of data may appear longer, when
received.
.PP
The
.B eni
routines reserve two bytes from the data area for their own use, so the
actual amount of data in the packet, once on the Ethernet, is two bytes
greater than specified by
.IR dlen .
.SH "SEE ALSO"
eni_get_packet(L), eni_send_packet(L)
.SH AUTHOR
Bill Heelan, McGill University SOCS

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.