00001 #ifndef _GPXE_UDP_H 00002 #define _GPXE_UDP_H 00003 00004 /** @file 00005 * 00006 * UDP protocol 00007 * 00008 * This file defines the gPXE UDP API. 00009 * 00010 */ 00011 00012 FILE_LICENCE ( GPL2_OR_LATER ); 00013 00014 #include <stddef.h> 00015 #include <gpxe/iobuf.h> 00016 #include <gpxe/tcpip.h> 00017 #include <gpxe/if_ether.h> 00018 00019 struct xfer_interface; 00020 00021 /** 00022 * UDP constants 00023 */ 00024 00025 #define UDP_MAX_HLEN 72 00026 #define UDP_MAX_TXIOB ETH_MAX_MTU 00027 #define UDP_MIN_TXIOB ETH_ZLEN 00028 00029 /** 00030 * A UDP header 00031 */ 00032 struct udp_header { 00033 /** Source port */ 00034 uint16_t src; 00035 /** Destination port */ 00036 uint16_t dest; 00037 /** Length */ 00038 uint16_t len; 00039 /** Checksum */ 00040 uint16_t chksum; 00041 }; 00042 00043 extern int udp_open_promisc ( struct xfer_interface *xfer ); 00044 extern int udp_open ( struct xfer_interface *xfer, struct sockaddr *peer, 00045 struct sockaddr *local ); 00046 00047 #endif /* _GPXE_UDP_H */ 00048
1.5.7.1