iPXE
Macros | Functions
bios_cachedhcp.c File Reference

Cached DHCP packet. More...

#include <stdint.h>
#include <string.h>
#include <ipxe/init.h>
#include <ipxe/cachedhcp.h>
#include <realmode.h>
#include <pxe_api.h>

Go to the source code of this file.

Macros

#define cached_dhcpack_phys   __use_data16 ( cached_dhcpack_phys )
 
#define colour   &cached_dhcpack_phys
 Colour for debug messages. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
uint32_t __bss16 (cached_dhcpack_phys)
 Cached DHCPACK physical address. More...
 
static void cachedhcp_init (void)
 Cached DHCPACK initialisation function. More...
 
struct init_fn cachedhcp_init_fn __init_fn (INIT_NORMAL)
 Cached DHCPACK initialisation function. More...
 

Detailed Description

Cached DHCP packet.

Definition in file bios_cachedhcp.c.

Macro Definition Documentation

◆ cached_dhcpack_phys

#define cached_dhcpack_phys   __use_data16 ( cached_dhcpack_phys )

Definition at line 44 of file bios_cachedhcp.c.

◆ colour

#define colour   &cached_dhcpack_phys

Colour for debug messages.

Definition at line 47 of file bios_cachedhcp.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ __bss16()

Cached DHCPACK physical address.

This can be set by the prefix.

◆ cachedhcp_init()

static void cachedhcp_init ( void  )
static

Cached DHCPACK initialisation function.

Definition at line 53 of file bios_cachedhcp.c.

53  {
54  int rc;
55 
56  /* Do nothing if no cached DHCPACK is present */
57  if ( ! cached_dhcpack_phys ) {
58  DBGC ( colour, "CACHEDHCP found no cached DHCPACK\n" );
59  return;
60  }
61 
62  /* Record cached DHCPACK */
63  if ( ( rc = cachedhcp_record ( &cached_dhcpack, 0,
64  phys_to_virt ( cached_dhcpack_phys ),
65  sizeof ( BOOTPLAYER_t ) ) ) != 0 ) {
66  DBGC ( colour, "CACHEDHCP could not record DHCPACK: %s\n",
67  strerror ( rc ) );
68  return;
69  }
70 
71  /* Mark as consumed */
73 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define cached_dhcpack_phys
#define DBGC(...)
Definition: compiler.h:505
int cachedhcp_record(struct cached_dhcp_packet *cache, unsigned int vlan, const void *data, size_t max_len)
Record cached DHCP packet.
Definition: cachedhcp.c:202
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
struct cached_dhcp_packet cached_dhcpack
Cached DHCPACK.
Definition: cachedhcp.c:62
#define colour
Colour for debug messages.
Format of buffer filled in by pxenv_get_cached_info()
Definition: pxe_api.h:322

References cached_dhcpack, cached_dhcpack_phys, cachedhcp_record(), colour, DBGC, rc, and strerror().

◆ __init_fn()

struct init_fn cachedhcp_init_fn __init_fn ( INIT_NORMAL  )

Cached DHCPACK initialisation function.