|
XenevaOS
|


Go to the source code of this file.
Classes | |
| struct | _netdev_ |
Macros | |
| #define | NETDEV_TYPE_ETHERNET 1 |
| #define | NETDEV_TYPE_802_11 2 |
| #define | NETDEV_TYPE_BLUETOOTH 3 |
| #define | NETDEV_TYPE_LOOPBACK 4 |
| #define | MAKE_IP(a, b, c, d) ((uint32_t)(d) << 24 | (uint32_t)(c) << 16 | (uint32_t)(b) << 8 | (uint32_t)(a)) |
| #define | htonl(l) ((((l) & 0xFF) << 24) | (((l) & 0xFF00) << 8) | (((l) & 0xFF0000) >> 8) | (((l) & 0xFF000000) >> 24)) |
| #define | htons(s) ((((s) & 0xFF) << 8) | (((s) & 0xFF00) >> 8)) |
| #define | ntohl(l) htonl((l)) |
| #define | ntohs(s) htons((s)) |
| #define | AUNET_GET_HARDWARE_ADDRESS 0x100 |
| #define | AUNET_SET_IPV4_ADDRESS 0x101 |
| #define | AUNET_GET_IPV4_ADDRESS 0x102 |
| #define | AUNET_GET_GATEWAY_ADDRESS 0x103 |
| #define | AUNET_SET_GATEWAY_ADDRESS 0x104 |
| #define | AUNET_GET_SUBNET_MASK 0x105 |
| #define | AUNET_SET_SUBNET_MASK 0x106 |
| #define | AUNET_GET_LINK_STATUS 0x107 |
| #define | AUNET_GET_IPV6_ADDRESS 0x108 |
| #define | AUNET_SET_IPV6_ADDRESS 0x109 |
| #define | AUNET_GET_IPV6_GATEWAY 0x10A |
| #define | AUNET_SET_IPV6_GATEWAY 0x10B |
| #define | AUNET_GET_IPV6_PREFIX 0x10C |
| #define | AUNET_SET_IPV6_PREFIX 0x10D |
| #define | WIFI_SCAN 0x140 |
| #define | WIFI_GET_SCAN 0x141 |
| #define | WIFI_CONNECT 0x142 |
| #define | WIFI_DISCONNECT 0x143 |
| #define | WIFI_GET_STATUS 0x144 |
| #define | WIFI_UPLINK 0x145 |
| #define | AU_DNS_MAX4 4 |
| #define | AU_DNS_MAX6 2 |
Typedefs | |
| typedef struct _netdev_ | AuNetworkDevice |
Functions | |
| void | AuInitialiseNet () |
| AuInitialiseNet – initialise network data structures. | |
| AU_EXTERN AU_EXPORT AuVFSNode * | AuAddNetAdapter (AuVFSNode *netfs, char *name) |
| AuAddNetAdapter – add a net adapter to the adapter list. | |
| AU_EXTERN AU_EXPORT int | AuRemoveNetAdapter (char *name) |
| AuRemoveNetAdapter – the driver behind an adapter is going away. The node itself stays (open handles and the stack may still point at it) but becomes a dead interface: writes are dropped, the link is down, and nothing points into the departing driver any more. A later AuAddNetAdapter with the same name revives it. | |
| AU_EXTERN AU_EXPORT AuVFSNode * | AuGetNetworkAdapter (char *name) |
| AuGetNetworkAdapter – get a network adapter. | |
| AuVFSNode * | AuNetworkRoute (uint32_t address) |
| AuNetworkRoute – select NIC for an IPv4 destination. | |
| AuVFSNode * | AuNetworkRoute6 (const ip6_addr *address) |
| int | AuAddrIsLocal4 (uint32_t address) |
| int | AuAddrIsLocal6 (const ip6_addr *address) |
| AU_EXTERN AU_EXPORT void | AuNetAddConnectedRoute4 (AuVFSNode *nic, const char *ifname) |
| AU_EXTERN AU_EXPORT void | AuNetAddConnectedRoute6 (AuVFSNode *nic, const char *ifname) |
| AU_EXTERN AU_EXPORT void | AuNetAddDefaultRoute4 (AuVFSNode *nic, const char *ifname) |
| AU_EXTERN AU_EXPORT void | AuNetAddDefaultRoute6 (AuVFSNode *nic, const char *ifname) |
| AU_EXTERN AU_EXPORT void | AuDnsAddServer4 (uint32_t addr) |
| AU_EXTERN AU_EXPORT void | AuDnsSetServer4 (int index, uint32_t addr) |
| int | AuDnsGetServer4 (int index, uint32_t *out) |
| AU_EXTERN AU_EXPORT void | AuDnsAddServer6 (const ip6_addr *addr) |
| AU_EXTERN AU_EXPORT void | AuDnsSetServer6 (int index, const ip6_addr *addr) |
| int | AuDnsGetServer6 (int index, ip6_addr *out) |
| AU_EXTERN AU_EXPORT void | AuNetRegisterRxPoll (void(*fn)(void)) |
| AU_EXTERN AU_EXPORT void | AuNetRxPoll (void) |
| #define AU_DNS_MAX4 4 |
| #define AU_DNS_MAX6 2 |
| #define AUNET_GET_GATEWAY_ADDRESS 0x103 |
| #define AUNET_GET_HARDWARE_ADDRESS 0x100 |
| #define AUNET_GET_IPV4_ADDRESS 0x102 |
| #define AUNET_GET_IPV6_ADDRESS 0x108 |
| #define AUNET_GET_IPV6_GATEWAY 0x10A |
| #define AUNET_GET_IPV6_PREFIX 0x10C |
| #define AUNET_GET_LINK_STATUS 0x107 |
| #define AUNET_GET_SUBNET_MASK 0x105 |
| #define AUNET_SET_GATEWAY_ADDRESS 0x104 |
| #define AUNET_SET_IPV4_ADDRESS 0x101 |
| #define AUNET_SET_IPV6_ADDRESS 0x109 |
| #define AUNET_SET_IPV6_GATEWAY 0x10B |
| #define AUNET_SET_IPV6_PREFIX 0x10D |
| #define AUNET_SET_SUBNET_MASK 0x106 |
| #define htonl | ( | l | ) | ((((l) & 0xFF) << 24) | (((l) & 0xFF00) << 8) | (((l) & 0xFF0000) >> 8) | (((l) & 0xFF000000) >> 24)) |
| #define htons | ( | s | ) | ((((s) & 0xFF) << 8) | (((s) & 0xFF00) >> 8)) |
| #define MAKE_IP | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) | ((uint32_t)(d) << 24 | (uint32_t)(c) << 16 | (uint32_t)(b) << 8 | (uint32_t)(a)) |
| #define NETDEV_TYPE_802_11 2 |
| #define NETDEV_TYPE_BLUETOOTH 3 |
| #define NETDEV_TYPE_ETHERNET 1 |
BSD 2-Clause License
Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define NETDEV_TYPE_LOOPBACK 4 |
| #define ntohl | ( | l | ) | htonl((l)) |
| #define ntohs | ( | s | ) | htons((s)) |
| #define WIFI_CONNECT 0x142 |
| #define WIFI_DISCONNECT 0x143 |
| #define WIFI_GET_SCAN 0x141 |
| #define WIFI_GET_STATUS 0x144 |
| #define WIFI_SCAN 0x140 |
| #define WIFI_UPLINK 0x145 |
| typedef struct _netdev_ AuNetworkDevice |
AuAddNetAdapter – add a net adapter to the adapter list.
|
extern |
|
extern |
|
extern |
|
extern |
AuGetNetworkAdapter – get a network adapter.
| name | – adapter name |
|
extern |
AuInitialiseNet – initialise network data structures.
AuNetworkRoute – select NIC for an IPv4 destination.
| address | – Address to consider (MAKE_IP/wire or host-order sockaddr) |
AuRemoveNetAdapter – the driver behind an adapter is going away. The node itself stays (open handles and the stack may still point at it) but becomes a dead interface: writes are dropped, the link is down, and nothing points into the departing driver any more. A later AuAddNetAdapter with the same name revives it.