Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| int | dhcp (struct net_device *netdev) |
| int | pxebs (struct net_device *netdev, unsigned int pxe_type) |
Definition in file dhcpmgmt.h.
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
| int dhcp | ( | struct net_device * | netdev | ) |
Definition at line 39 of file dhcpmgmt.c.
References dhcp_chaddr(), iflinkwait(), ifopen(), LINK_WAIT_MS, monojob, monojob_wait(), net_device::name, printf(), and start_dhcp().
Referenced by dhcp_deliver_iob(), dhcp_exec(), dhcp_free(), dhcp_job_kill(), dhcp_timer_expired(), netboot(), start_dhcp(), and start_pxebs().
00039 { 00040 uint8_t *chaddr; 00041 uint8_t hlen; 00042 uint16_t flags; 00043 int rc; 00044 00045 /* Check we can open the interface first */ 00046 if ( ( rc = ifopen ( netdev ) ) != 0 ) 00047 return rc; 00048 00049 /* Wait for link-up */ 00050 if ( ( rc = iflinkwait ( netdev, LINK_WAIT_MS ) ) != 0 ) 00051 return rc; 00052 00053 /* Perform DHCP */ 00054 chaddr = dhcp_chaddr ( netdev, &hlen, &flags ); 00055 printf ( "DHCP (%s ", netdev->name ); 00056 while ( hlen-- ) 00057 printf ( "%02x%c", *(chaddr++), ( hlen ? ':' : ')' ) ); 00058 00059 if ( ( rc = start_dhcp ( &monojob, netdev ) ) == 0 ) { 00060 rc = monojob_wait ( "" ); 00061 } else if ( rc > 0 ) { 00062 printf ( " using cached\n" ); 00063 rc = 0; 00064 } 00065 00066 return rc; 00067 }
| int pxebs | ( | struct net_device * | netdev, | |
| unsigned int | pxe_type | |||
| ) |
Definition at line 69 of file dhcpmgmt.c.
References monojob, monojob_wait(), net_device::name, printf(), and start_pxebs().
Referenced by pxe_menu_boot(), and pxebs_exec().
00069 { 00070 int rc; 00071 00072 /* Perform PXE Boot Server Discovery */ 00073 printf ( "PXEBS (%s type %d)", netdev->name, pxe_type ); 00074 if ( ( rc = start_pxebs ( &monojob, netdev, pxe_type ) ) == 0 ) 00075 rc = monojob_wait ( "" ); 00076 00077 return rc; 00078 }
1.5.7.1