8 #include <netinet/in.h>
9 #include <sys/socket.h>
12 #define SOL_CONFIG 0xfffe
51 #define ROUTING_FLAG_G 0x01
72 #define TCP_STATE_CLOSED 1
73 #define TCP_STATE_LISTEN 2
74 #define TCP_STATE_ESTABLISHED 5
75 #define TCP_STATE_FINWAIT1 6
76 #define TCP_STATE_FINWAIT2 7
77 #define TCP_STATE_CLOSE_WAIT 8
78 #define TCP_STATE_LAST_ACK 9
79 #define TCP_STATE_TIME_WAIT 11
121 int gethostname(
char *name,
size_t namelen);
123 int SOCU_ShutdownSockets(
void);
125 int SOCU_CloseSockets(
void);
int SOCU_GetNetworkOpt(int level, NetworkOpt optname, void *optval, socklen_t *optlen)
Retrieves information from the network configuration.
Result socInit(u32 *context_addr, u32 context_size)
Initializes the SOC service.
int SOCU_AddGlobalSocket(int sockfd)
Adds a global socket.
Result socExit(void)
Closes the soc service.
NetworkOpt
Options to be used with SOCU_GetNetworkOpt.
Definition: soc.h:16
@ NETOPT_MAC_ADDRESS
The mac address of the interface (u32 mac[6])
Definition: soc.h:17
@ NETOPT_DNS_TABLE
The table of the DNS servers.
Definition: soc.h:26
@ NETOPT_TCP_NUMBER
The number of sockets in the TCP table (u32)
Definition: soc.h:24
@ NETOPT_DHCP_LEASE_TIME
The DHCP lease time remaining, in seconds.
Definition: soc.h:27
@ NETOPT_TCP_TABLE
The table of opened TCP sockets.
Definition: soc.h:25
@ NETOPT_ROUTING_TABLE
The routing table.
Definition: soc.h:21
@ NETOPT_UDP_NUMBER
The number of sockets in the UDP table (u32)
Definition: soc.h:22
@ NETOPT_UDP_TABLE
The table of opened UDP sockets.
Definition: soc.h:23
@ NETOPT_ARP_TABLE
The ARP table.
Definition: soc.h:18
@ NETOPT_IP_INFO
The current IP setup.
Definition: soc.h:19
@ NETOPT_IP_MTU
The value of the IP MTU (u32)
Definition: soc.h:20
int SOCU_GetIPInfo(struct in_addr *ip, struct in_addr *netmask, struct in_addr *broadcast)
Gets the system's IP address, netmask, and subnet broadcast.
long gethostid(void)
Gets the system's host ID.
One entry of the ARP table retrieved by using SOCU_GetNetworkOpt and NETOPT_ARP_TABLE.
Definition: soc.h:32
One entry of the DNS servers table retrieved by using SOCU_GetNetworkOpt and NETOPT_DNS_TABLE.
Definition: soc.h:92
Structure returned by SOCU_GetNetworkOpt when using NETOPT_IP_INFO.
Definition: soc.h:41
One entry of the routing table retrieved by using SOCU_GetNetworkOpt and NETOPT_ROUTING_TABLE.
Definition: soc.h:55
u32 flags
Linux netstat flags.
Definition: soc.h:59
One entry of the TCP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_TCP_TABLE.
Definition: soc.h:84
One entry of the UDP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_UDP_TABLE.
Definition: soc.h:65
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
s32 Result
Function result.
Definition: types.h:42
uint32_t u32
32-bit unsigned integer
Definition: types.h:23