david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/include/gpxe/ip.h
Michael Brown 467e9627cc Added features that will be required for PXE UDP support.
Introduced struct sockaddr_tcpip, to simplify code that deals with
both IPv4 and IPv6 addresses.

Reorganised parts of tcpip.c and udp.c.
2006-08-02 00:02:21 +00:00

68 lines
1.3 KiB
C

#ifndef _GPXE_IP_H
#define _GPXE_IP_H
/** @file
*
* IP protocol
*
*/
#include <ip.h>
#include <gpxe/retry.h>
/* IP constants */
#define IP_VER 4
#define IP_MASK_VER 0xf0
#define IP_MASK_HLEN 0x0f
#define IP_MASK_OFFSET 0x1fff
#define IP_MASK_DONOTFRAG 0x4000
#define IP_MASK_MOREFRAGS 0x2000
#define IP_PSHLEN 12
/* IP header defaults */
#define IP_TOS 0
#define IP_TTL 64
#define IP_FRAG_PKB_SIZE 1500
#define IP_FRAG_TIMEOUT 50
/* IP4 pseudo header */
struct ipv4_pseudo_header {
struct in_addr src;
struct in_addr dest;
uint8_t zero_padding;
uint8_t protocol;
uint16_t len;
};
/* Fragment reassembly buffer */
struct frag_buffer {
/* Identification number */
uint16_t ident;
/* Source network address */
struct in_addr src;
/* Destination network address */
struct in_addr dest;
/* Reassembled packet buffer */
struct pk_buff *frag_pkb;
/* Reassembly timer */
struct retry_timer frag_timer;
/* List of fragment reassembly buffers */
struct list_head list;
};
struct pk_buff;
struct net_device;
struct net_protocol;
struct tcpip_protocol;
extern struct net_protocol ipv4_protocol;
extern int add_ipv4_address ( struct net_device *netdev,
struct in_addr address, struct in_addr netmask,
struct in_addr gateway );
extern void del_ipv4_address ( struct net_device *netdev );
#endif /* _GPXE_IP_H */