iPXE
Data Structures | Defines | 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...

Defines

#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.
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.
struct net_protocol ipv4_protocol __net_protocol
 AoE protocol.

Detailed Description

IP protocol.

Definition in file ip.h.


Define Documentation

#define IP_VER   0x40U

Definition at line 22 of file ip.h.

Referenced by gdbudp_send(), ipv4_rx(), and ipv4_tx().

#define IP_MASK_VER   0xf0U

Definition at line 23 of file ip.h.

Referenced by ipv4_rx().

#define IP_MASK_HLEN   0x0fU

Definition at line 24 of file ip.h.

Referenced by ipv4_pshdr_chksum(), and ipv4_rx().

#define IP_MASK_OFFSET   0x1fffU

Definition at line 25 of file ip.h.

Referenced by ipv4_fragment_offset(), and ipv4_rx().

#define IP_MASK_DONOTFRAG   0x4000U

Definition at line 26 of file ip.h.

#define IP_MASK_MOREFRAGS   0x2000U

Definition at line 27 of file ip.h.

Referenced by ipv4_more_fragments(), and ipv4_rx().

#define IP_PSHLEN   12

Definition at line 28 of file ip.h.

#define IP_TOS   0

Definition at line 31 of file ip.h.

Referenced by gdbudp_send(), and ipv4_tx().

#define IP_TTL   64

Definition at line 32 of file ip.h.

Referenced by gdbudp_send(), and ipv4_tx().


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
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.

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

Referenced by dhcp_create_packet(), and ipv4_rx().

                                                    {
        struct ipv4_miniroute *miniroute;

        list_for_each_entry ( miniroute, &ipv4_miniroutes, list ) {
                if ( miniroute->netdev == netdev )
                        return 1;
        }
        return 0;
}
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 
)

Variable Documentation

List of IPv4 miniroutes.

Definition at line 57 of file ipv4.c.

Referenced by route_ipv4_print().

struct net_protocol ipv4_protocol __net_protocol

AoE protocol.

AoE protocol.

FIP protocol.

Definition at line 55 of file aoe.c.