mirror of
https://github.com/ipxe/ipxe
synced 2025-12-17 01:52:08 +03:00
Added set_netmask() and set_gateway()
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
#include <gpxe/in.h>
|
#include <gpxe/in.h>
|
||||||
|
|
||||||
extern void set_ipaddr ( struct in_addr address );
|
extern void set_ipaddr ( struct in_addr address );
|
||||||
|
extern void set_netmask ( struct in_addr address );
|
||||||
|
extern void set_gateway ( struct in_addr address );
|
||||||
extern void init_tcpip ( void );
|
extern void init_tcpip ( void );
|
||||||
extern void run_tcpip ( void );
|
extern void run_tcpip ( void );
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,34 @@ void set_ipaddr ( struct in_addr address ) {
|
|||||||
uip_sethostaddr ( u.uip_address );
|
uip_sethostaddr ( u.uip_address );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set netmask
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void set_netmask ( struct in_addr address ) {
|
||||||
|
union {
|
||||||
|
struct in_addr address;
|
||||||
|
uint16_t uip_address[2];
|
||||||
|
} u;
|
||||||
|
|
||||||
|
u.address = address;
|
||||||
|
uip_setnetmask ( u.uip_address );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set default gateway
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void set_gateway ( struct in_addr address ) {
|
||||||
|
union {
|
||||||
|
struct in_addr address;
|
||||||
|
uint16_t uip_address[2];
|
||||||
|
} u;
|
||||||
|
|
||||||
|
u.address = address;
|
||||||
|
uip_setdraddr ( u.uip_address );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise TCP/IP stack
|
* Initialise TCP/IP stack
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user