XenevaOS
Loading...
Searching...
No Matches
aunet.h
Go to the documentation of this file.
1
30#ifndef __AUNET_H__
31#define __AUNET_H__
32
33#include <stdint.h>
34#include <aurora.h>
35#include <Fs\vfs.h>
36
37#define NETDEV_TYPE_ETHERNET 1
38#define NETDEV_TYPE_802_11 2
39#define NETDEV_TYPE_BLUETOOTH 3
40
41#ifdef ARCH_X64
42#pragma pack(push,1)
43#endif
55#ifdef ARCH_X64
56#pragma pack(pop)
57#endif
58
59
60#define htonl(l) ((((l) & 0xFF) << 24) | (((l) & 0xFF00) << 8) | (((l) & 0xFF0000) >> 8) | (((l) & 0xFF000000) >> 24))
61#define htons(s) ((((s) & 0xFF) << 8) | (((s) & 0xFF00) >> 8))
62#define ntohl(l) htonl((l))
63#define ntohs(s) htons((s))
64
65/*I/O Codes used for network interfaces */
66#define AUNET_GET_HARDWARE_ADDRESS 0x100
67#define AUNET_SET_IPV4_ADDRESS 0x101
68#define AUNET_GET_IPV4_ADDRESS 0x102
69#define AUNET_GET_GATEWAY_ADDRESS 0x103
70#define AUNET_SET_GATEWAY_ADDRESS 0x104
71#define AUNET_GET_SUBNET_MASK 0x105
72#define AUNET_SET_SUBNET_MASK 0x106
73#define AUNET_GET_LINK_STATUS 0x107
74
75/*
76* AuInitialiseNet -- initialise network data structures
77*/
78extern void AuInitialiseNet();
79
80/*
81* AuAddNetAdapter -- add a net adapter to the adapter
82* list
83*/
84AU_EXTERN AU_EXPORT void AuAddNetAdapter(AuVFSNode* netfs,char* name);
85/*
86* AuGetNetworkAdapter -- get a network adapter
87* @param name -- adapter name
88*/
90
91/* AuNetworkRoute -- For now, route table is
92* is not implemented, simply return the default
93* network card installed in Xeneva
94* @param address -- Address to consider
95*/
96extern AuVFSNode* AuNetworkRoute(uint32_t address);
97
98#endif
#define AU_EXTERN
Definition aurora.h:50
#define AU_EXPORT
Definition aurora.h:38
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161
AU_EXTERN AU_EXPORT void AuAddNetAdapter(AuVFSNode *netfs, char *name)
AuAddNetAdapter – add a net adapter to the adapter list.
Definition aunet.cpp:66
AuVFSNode * AuNetworkRoute(uint32_t address)
AuNetworkRoute – For now, route table is is not implemented, simply return the default network card i...
Definition aunet.cpp:87
struct _netdev_ AuNetworkDevice
AU_EXTERN AU_EXPORT AuVFSNode * AuGetNetworkAdapter(char *name)
AuGetNetworkAdapter – get a network adapter.
Definition aunet.cpp:77
void AuInitialiseNet()
AuInitialiseNet – initialise network data structures.
Definition aunet.cpp:48
Definition vfs.h:95
Definition aunet.h:44
int linkStatus
Definition aunet.h:46
uint32_t dns_ipv4_2
Definition aunet.h:52
uint32_t ipv4addr
Definition aunet.h:48
uint8_t type
Definition aunet.h:47
uint32_t ipv4gateway
Definition aunet.h:50
uint32_t dns_ipv4_1
Definition aunet.h:51
uint8_t mac[6]
Definition aunet.h:45
uint32_t dns_ipv4_3
Definition aunet.h:53
uint32_t ipv4subnet
Definition aunet.h:49