next up previous contents index
Next: 26.3.6 oskit_freebsd_net_add_default_route: set a Up: 26.3 Interfaces Previous: 26.3.4 oskit_freebsd_net_close_ether_if: close an

26.3.5 oskit_freebsd_net_ifconfig: configure an interface

 

SYNOPSIS

#include <oskit/net/freebsd.h>

oskit_error_t oskit_freebsd_net_ifconfig( struct oskit_freebsd_net_ether_if *eif, char *name, char *ipaddr, char *netmask);

DIRECTION

OS tex2html_wrap_inline32841 Network stack

DESCRIPTION

This is a temporary convenience function which does the setup usually performed by FreeBSD's ifconfig(8) command. This function is equivalent to the following command:
	ifconfig de0 inet 155.99.214.164 link2 netmask 255.255.255.0
with 155.99.214.164 being the IP address to be used by the ethernet interface, 255.255.255.0 the netmask of the local subnet, and de0 the (arbitrary) name of the interface.

PARAMETERS

eif
A structure describing the physical interface as returned by oskit_freebsd_net_open_ether_if.

name
The name of the interface. Should be a 3 byte string of the "abn" where a and b are letters and n is a number. Use different names for different interfaces.

ipaddr
The address to be used by the interface in "xxx.xxx.xxx.xxx" notation.

netmask
The netmask of the subnet to be used by the interface in "xxx.xxx.xxx.xxx" notation.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



University of Utah Flux Research Group