XenevaOS
Loading...
Searching...
No Matches
Functions
aunet.c File Reference
#include <Net/aunet.h>
#include <Net/arp.h>
#include <Net/ndp.h>
#include <Mm/kmalloc.h>
#include <string.h>
#include <_null.h>
#include <hashmap.h>
#include <Fs/Dev/devfs.h>
#include <Net/socket.h>
#include <Net/route.h>
#include <Net/netfilter.h>
#include <Net/udp.h>
#include <Net/icmp.h>
#include <Net/icmpv6.h>
#include <Net/tcp.h>
#include <aucon.h>
#include <Drivers/uart.h>
Include dependency graph for aunet.c:

Functions

void AuNetRegisterRxPoll (void(*fn)(void))
 
void AuNetRxPoll (void)
 
void AuDnsAddServer4 (uint32_t addr)
 
void AuDnsSetServer4 (int index, uint32_t addr)
 
int AuDnsGetServer4 (int index, uint32_t *out)
 
void AuDnsAddServer6 (const ip6_addr *addr)
 
void AuDnsSetServer6 (int index, const ip6_addr *addr)
 
int AuDnsGetServer6 (int index, ip6_addr *out)
 
void AuInitialiseNet ()
 AuInitialiseNet – initialise network data structures.
 
AuVFSNode * AuAddNetAdapter (AuVFSNode *netfs, char *name)
 AuAddNetAdapter – add a net adapter to the adapter list.
 
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.
 
AuVFSNode * AuGetNetworkAdapter (char *name)
 AuGetNetworkAdapter – get a network adapter.
 
int AuAddrIsLocal4 (uint32_t address)
 
int AuAddrIsLocal6 (const ip6_addr *address)
 
void AuNetAddConnectedRoute4 (AuVFSNode *nic, const char *ifname)
 
void AuNetAddDefaultRoute4 (AuVFSNode *nic, const char *ifname)
 
void AuNetAddConnectedRoute6 (AuVFSNode *nic, const char *ifname)
 
void AuNetAddDefaultRoute6 (AuVFSNode *nic, const char *ifname)
 
AuVFSNode * AuNetworkRoute (uint32_t address)
 AuNetworkRoute – select NIC for an IPv4 destination.
 
AuVFSNode * AuNetworkRoute6 (const ip6_addr *address)
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2026, 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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

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.

Function Documentation

◆ AuAddNetAdapter()

AuVFSNode * AuAddNetAdapter ( AuVFSNode *  netfs,
char *  name 
)

AuAddNetAdapter – add a net adapter to the adapter list.

◆ AuAddrIsLocal4()

int AuAddrIsLocal4 ( uint32_t  address)

◆ AuAddrIsLocal6()

int AuAddrIsLocal6 ( const ip6_addr *  address)

◆ AuDnsAddServer4()

void AuDnsAddServer4 ( uint32_t  addr)

◆ AuDnsAddServer6()

void AuDnsAddServer6 ( const ip6_addr *  addr)

◆ AuDnsGetServer4()

int AuDnsGetServer4 ( int  index,
uint32_t *  out 
)

◆ AuDnsGetServer6()

int AuDnsGetServer6 ( int  index,
ip6_addr *  out 
)

◆ AuDnsSetServer4()

void AuDnsSetServer4 ( int  index,
uint32_t  addr 
)

◆ AuDnsSetServer6()

void AuDnsSetServer6 ( int  index,
const ip6_addr *  addr 
)

◆ AuGetNetworkAdapter()

AuVFSNode * AuGetNetworkAdapter ( char *  name)

AuGetNetworkAdapter – get a network adapter.

Parameters
name– adapter name

◆ AuInitialiseNet()

void AuInitialiseNet ( )

AuInitialiseNet – initialise network data structures.

◆ AuNetAddConnectedRoute4()

void AuNetAddConnectedRoute4 ( AuVFSNode *  nic,
const char *  ifname 
)

◆ AuNetAddConnectedRoute6()

void AuNetAddConnectedRoute6 ( AuVFSNode *  nic,
const char *  ifname 
)

◆ AuNetAddDefaultRoute4()

void AuNetAddDefaultRoute4 ( AuVFSNode *  nic,
const char *  ifname 
)

◆ AuNetAddDefaultRoute6()

void AuNetAddDefaultRoute6 ( AuVFSNode *  nic,
const char *  ifname 
)

◆ AuNetRegisterRxPoll()

void AuNetRegisterRxPoll ( void(*)(void)  fn)

◆ AuNetRxPoll()

void AuNetRxPoll ( void  )

◆ AuNetworkRoute()

AuVFSNode * AuNetworkRoute ( uint32_t  address)

AuNetworkRoute – select NIC for an IPv4 destination.

Parameters
address– Address to consider (MAKE_IP/wire or host-order sockaddr)

◆ AuNetworkRoute6()

AuVFSNode * AuNetworkRoute6 ( const ip6_addr *  address)

◆ AuRemoveNetAdapter()

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.

Returns
0 if it existed, -1 otherwise