iPXE
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.

Functions

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

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.

Referenced by __bss16(), and cachedhcp_init().

◆ 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.

References cached_dhcpack_phys.

◆ cachedhcp_init()

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}
#define colour
Colour for debug messages.
Definition acpi.c:42
struct arbelprm_rc_send_wqe rc
Definition arbel.h:3
#define cached_dhcpack_phys
struct cached_dhcp_packet cached_dhcpack
Cached DHCPACK.
Definition cachedhcp.c:63
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:203
#define DBGC(...)
Definition compiler.h:505
struct bootph BOOTPLAYER_t
Definition pxe_api.h:406
char * strerror(int errno)
Retrieve string representation of error number.
Definition strerror.c:79

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

Referenced by __init_fn().

◆ __init_fn()

struct init_fn cachedhcp_init_fn __init_fn ( INIT_NORMAL )

Cached DHCPACK initialisation function.

References __init_fn, cachedhcp_init(), and INIT_NORMAL.