1 #ifndef _sw_interface_h
2 #define _sw_interface_h
5 * Copyright 2003, 2004 Porchdog Software. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without modification,
8 * are permitted provided that the following conditions are met:
10 * 1. Redistributions of source code must retain the above copyright notice,
11 * this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright notice,
13 * this list of conditions and the following disclaimer in the documentation
14 * and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE HOWL PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
24 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25 * OF THE POSSIBILITY OF SUCH DAMAGE.
27 * The views and conclusions contained in the software and documentation are those
28 * of the authors and should not be interpreted as representing official policies,
29 * either expressed or implied, of Porchdog Software.
32 #include <salt/address.h>
34 struct _sw_network_interface;
35 typedef struct _sw_network_interface * sw_network_interface;
38 typedef enum _sw_network_interface_state
40 SW_NETWORK_INTERFACE_RUNNING = 0x1,
41 } sw_network_interface_state;
44 typedef struct _sw_mac_address
51 sw_network_interfaces(
53 sw_network_interface ** netifs);
57 sw_network_interfaces_fina(
59 sw_network_interface * netifs);
63 sw_network_interface_fina(
64 sw_network_interface netif);
68 sw_network_interface_by_name(
70 sw_network_interface * netif);
74 sw_network_interface_name(
75 sw_network_interface netif,
81 sw_network_interface_mac_address(
82 sw_network_interface netif,
83 sw_mac_address * addr);
87 sw_network_interface_ipv4_address(
88 sw_network_interface netif,
89 sw_ipv4_address * addr);
93 sw_network_interface_set_ipv4_address(
94 sw_network_interface netif,
95 sw_ipv4_address addr);
99 sw_network_interface_index(
100 sw_network_interface netif,
105 sw_network_interface_linked(
106 sw_network_interface netif,
111 sw_network_interface_up(
112 sw_network_interface netif);