Home | History | Annotate | Download | only in gpxe
      1 #ifndef _GPXE_UDP_H
      2 #define _GPXE_UDP_H
      3 
      4 /** @file
      5  *
      6  * UDP protocol
      7  *
      8  * This file defines the gPXE UDP API.
      9  *
     10  */
     11 
     12 FILE_LICENCE ( GPL2_OR_LATER );
     13 
     14 #include <stddef.h>
     15 #include <gpxe/iobuf.h>
     16 #include <gpxe/tcpip.h>
     17 #include <gpxe/if_ether.h>
     18 
     19 struct xfer_interface;
     20 
     21 /**
     22  * UDP constants
     23  */
     24 
     25 #define UDP_MAX_HLEN	72
     26 #define UDP_MAX_TXIOB	ETH_MAX_MTU
     27 #define UDP_MIN_TXIOB	ETH_ZLEN
     28 
     29 /**
     30  * A UDP header
     31  */
     32 struct udp_header {
     33 	/** Source port */
     34 	uint16_t src;
     35 	/** Destination port */
     36 	uint16_t dest;
     37 	/** Length */
     38 	uint16_t len;
     39 	/** Checksum */
     40 	uint16_t chksum;
     41 };
     42 
     43 extern int udp_open_promisc ( struct xfer_interface *xfer );
     44 extern int udp_open ( struct xfer_interface *xfer, struct sockaddr *peer,
     45 		      struct sockaddr *local );
     46 
     47 #endif /* _GPXE_UDP_H */
     48 
     49