iPXE
Data Structures | Macros | Functions | Variables
ip.h File Reference

IP protocol. More...

#include <stdint.h>
#include <ipxe/in.h>
#include <ipxe/list.h>
#include <ipxe/retry.h>
#include <ipxe/netdevice.h>

Go to the source code of this file.

Data Structures

struct  iphdr
 An IPv4 packet header. More...
 
struct  ipv4_pseudo_header
 An IPv4 pseudo header. More...
 
struct  ipv4_miniroute
 An IPv4 address/routing table entry. More...
 

Macros

#define IP_VER   0x40U
 
#define IP_MASK_VER   0xf0U
 
#define IP_MASK_HLEN   0x0fU
 
#define IP_MASK_OFFSET   0x1fffU
 
#define IP_MASK_DONOTFRAG   0x4000U
 
#define IP_MASK_MOREFRAGS   0x2000U
 
#define IP_PSHLEN   12
 
#define IP_TOS   0
 
#define IP_TTL   64
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
int ipv4_has_any_addr (struct net_device *netdev)
 Check if network device has any IPv4 address. More...
 
int parse_ipv4_setting (const struct setting_type *type, const char *value, void *buf, size_t len)
 
int format_ipv4_setting (const struct setting_type *type, const void *raw, size_t raw_len, char *buf, size_t len)
 

Variables

struct list_head ipv4_miniroutes
 List of IPv4 miniroutes. More...
 
struct net_protocol ipv4_protocol __net_protocol
 AoE protocol. More...
 

Detailed Description

IP protocol.

Definition in file ip.h.

Macro Definition Documentation

◆ IP_VER

#define IP_VER   0x40U

Definition at line 22 of file ip.h.

◆ IP_MASK_VER

#define IP_MASK_VER   0xf0U

Definition at line 23 of file ip.h.

◆ IP_MASK_HLEN

#define IP_MASK_HLEN   0x0fU

Definition at line 24 of file ip.h.

◆ IP_MASK_OFFSET

#define IP_MASK_OFFSET   0x1fffU

Definition at line 25 of file ip.h.

◆ IP_MASK_DONOTFRAG

#define IP_MASK_DONOTFRAG   0x4000U

Definition at line 26 of file ip.h.

◆ IP_MASK_MOREFRAGS

#define IP_MASK_MOREFRAGS   0x2000U

Definition at line 27 of file ip.h.

◆ IP_PSHLEN

#define IP_PSHLEN   12

Definition at line 28 of file ip.h.

◆ IP_TOS

#define IP_TOS   0

Definition at line 31 of file ip.h.

◆ IP_TTL

#define IP_TTL   64

Definition at line 32 of file ip.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ ipv4_has_any_addr()

int ipv4_has_any_addr ( struct net_device netdev)

Check if network device has any IPv4 address.

Parameters
netdevNetwork device
Return values
has_any_addrNetwork device has any IPv4 address

Definition at line 433 of file ipv4.c.

433  {
434  struct ipv4_miniroute *miniroute;
435 
436  list_for_each_entry ( miniroute, &ipv4_miniroutes, list ) {
437  if ( miniroute->netdev == netdev )
438  return 1;
439  }
440  return 0;
441 }
struct list_head list
List of miniroutes.
Definition: ip.h:60
struct net_device * netdev
Network device.
Definition: ip.h:63
An IPv4 address/routing table entry.
Definition: ip.h:58
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:431
static struct net_device * netdev
Definition: gdbudp.c:52
struct list_head ipv4_miniroutes
List of IPv4 miniroutes.
Definition: ipv4.c:57

References ipv4_miniroutes, ipv4_miniroute::list, list_for_each_entry, netdev, and ipv4_miniroute::netdev.

Referenced by dhcp_create_packet(), and ipv4_rx().

◆ parse_ipv4_setting()

int parse_ipv4_setting ( const struct setting_type type,
const char *  value,
void *  buf,
size_t  len 
)

◆ format_ipv4_setting()

int format_ipv4_setting ( const struct setting_type type,
const void *  raw,
size_t  raw_len,
char *  buf,
size_t  len 
)

Variable Documentation

◆ ipv4_miniroutes

struct list_head ipv4_miniroutes

List of IPv4 miniroutes.

Definition at line 57 of file ipv4.c.

Referenced by add_ipv4_miniroute(), ipv4_create_routes(), ipv4_has_addr(), ipv4_has_any_addr(), ipv4_route(), and route_ipv4_print().

◆ __net_protocol

struct net_protocol ipv4_protocol __net_protocol

AoE protocol.

AoE protocol.

AoE protocol.

FIP protocol.

Definition at line 56 of file aoe.c.