2010-04-19 21:16:01 +02:00
|
|
|
#ifndef _IPXE_UDP_H
|
|
|
|
#define _IPXE_UDP_H
|
2006-06-18 01:34:48 +02:00
|
|
|
|
|
|
|
/** @file
|
|
|
|
*
|
|
|
|
* UDP protocol
|
|
|
|
*
|
2010-04-19 21:16:01 +02:00
|
|
|
* This file defines the iPXE UDP API.
|
2006-06-18 01:34:48 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-03-02 14:29:46 +01:00
|
|
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
2009-05-01 16:41:06 +02:00
|
|
|
|
2006-06-18 01:34:48 +02:00
|
|
|
#include <stddef.h>
|
2010-04-19 21:16:01 +02:00
|
|
|
#include <ipxe/iobuf.h>
|
|
|
|
#include <ipxe/tcpip.h>
|
|
|
|
#include <ipxe/if_ether.h>
|
2006-06-25 07:13:17 +02:00
|
|
|
|
2010-06-16 02:31:29 +02:00
|
|
|
struct interface;
|
|
|
|
struct sockaddr;
|
2007-01-10 03:31:38 +01:00
|
|
|
|
2006-06-25 07:13:17 +02:00
|
|
|
/**
|
|
|
|
* UDP constants
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A UDP header
|
|
|
|
*/
|
|
|
|
struct udp_header {
|
2007-06-20 02:13:35 +02:00
|
|
|
/** Source port */
|
|
|
|
uint16_t src;
|
|
|
|
/** Destination port */
|
|
|
|
uint16_t dest;
|
|
|
|
/** Length */
|
2006-06-28 09:46:28 +02:00
|
|
|
uint16_t len;
|
2007-06-20 02:13:35 +02:00
|
|
|
/** Checksum */
|
2006-06-28 09:46:28 +02:00
|
|
|
uint16_t chksum;
|
2006-06-25 07:13:17 +02:00
|
|
|
};
|
2006-06-18 01:34:48 +02:00
|
|
|
|
2010-06-16 02:31:29 +02:00
|
|
|
extern int udp_open_promisc ( struct interface *xfer );
|
|
|
|
extern int udp_open ( struct interface *xfer, struct sockaddr *peer,
|
2007-06-20 02:13:35 +02:00
|
|
|
struct sockaddr *local );
|
2006-06-25 07:13:17 +02:00
|
|
|
|
2010-04-19 21:16:01 +02:00
|
|
|
#endif /* _IPXE_UDP_H */
|
2007-06-20 02:13:35 +02:00
|
|
|
|