KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Macros | Typedefs | Functions | Variables
net.h File Reference

Network support. More...

#include <sys/cdefs.h>
#include <arch/types.h>
#include <sys/queue.h>
#include <netinet/in.h>

Go to the source code of this file.

Data Structures

struct  knetif
 Structure describing one usable network device. More...
 
struct  ip_hdr_s
 IPv4 Packet header. More...
 
struct  ipv6_hdr_s
 IPv6 Packet header. More...
 
struct  net_ipv4_stats
 IPv4 statistics structure. More...
 
struct  net_ipv6_stats
 IPv6 statistics structure. More...
 
struct  net_udp_stats
 UDP statistics structure. More...
 

Macros

#define NETIF_NO_FLAGS   0x00000000
 No flags set. More...
 
#define NETIF_REGISTERED   0x00000001
 Is it registered? More...
 
#define NETIF_DETECTED   0x00000002
 Is it detected? More...
 
#define NETIF_INITIALIZED   0x00000004
 Has it been initialized? More...
 
#define NETIF_RUNNING   0x00000008
 Has start() been called? More...
 
#define NETIF_PROMISC   0x00010000
 Promiscuous mode. More...
 
#define NETIF_NEEDSPOLL   0x01000000
 Needs to be polled for input. More...
 
#define NETIF_NOETH   0x10000000
 Does not use ethernet. More...
 
#define NETIF_TX_OK   0
 Tx success. More...
 
#define NETIF_TX_ERROR   -1
 Tx general error. More...
 
#define NETIF_TX_AGAIN   -2
 Retry Tx later. More...
 
#define NETIF_NOBLOCK   0
 Don't block for Tx. More...
 
#define NETIF_BLOCK   1
 Blocking is OK for Tx. More...
 
#define ICMP_PROTOCOL_UNREACHABLE   2
 Protocol unreachable. More...
 
#define ICMP_PORT_UNREACHABLE   3
 Port unreachable. More...
 
#define ICMP_REASSEMBLY_TIME_EXCEEDED   1
 Reassembly time gone. More...
 
#define ICMP6_DEST_UNREACH_NO_ROUTE   0
 No route available. More...
 
#define ICMP6_DEST_UNREACH_PROHIBITED   1
 Access prohibited. More...
 
#define ICMP6_DEST_UNREACH_BEYOND_SCOPE   2
 Gone beyond scope. More...
 
#define ICMP6_DEST_UNREACH_ADDR_UNREACH   3
 Address unreachable. More...
 
#define ICMP6_DEST_UNREACH_PORT_UNREACH   4
 Port unreachable. More...
 
#define ICMP6_DEST_UNREACH_FAIL_EGRESS   5
 Egress failure. More...
 
#define ICMP6_DEST_UNREACH_BAD_ROUTE   6
 Bad route specified. More...
 
#define ICMP6_TIME_EXCEEDED_HOPS_EXC   0
 Hops exceeded. More...
 
#define ICMP6_TIME_EXCEEDED_FRAGMENT   1
 Reassembly time gone. More...
 
#define ICMP6_PARAM_PROB_BAD_HEADER   0
 Malformed header. More...
 
#define ICMP6_PARAM_PROB_UNK_HEADER   1
 Unknown header. More...
 
#define ICMP6_PARAM_PROB_UNK_OPTION   2
 Unknown header option. More...
 

Typedefs

typedef struct knetif netif_t
 Structure describing one usable network device. More...
 
typedef struct ip_hdr_s ip_hdr_t
 IPv4 Packet header. More...
 
typedef struct ipv6_hdr_s ipv6_hdr_t
 IPv6 Packet header. More...
 
typedef int(* net_input_func )(netif_t *nif, const uint8 *pkt, int len)
 Network input callback type. More...
 
typedef void(* net_echo_cb )(const uint8 *ip, uint16 seq, uint64 delta_us, uint8 ttl, const uint8 *data, size_t len)
 ICMPv4 echo reply callback type. More...
 
typedef struct net_ipv4_stats net_ipv4_stats_t
 IPv4 statistics structure. More...
 
typedef void(* net6_echo_cb )(const struct in6_addr *ip, uint16 seq, uint64 delta_us, uint8 hlim, const uint8 *data, size_t len)
 ICMPv6 echo reply callback type. More...
 
typedef struct net_ipv6_stats net_ipv6_stats_t
 IPv6 statistics structure. More...
 
typedef struct net_udp_stats net_udp_stats_t
 UDP statistics structure. More...
 

Functions

int net_arp_init (void)
 Init ARP. More...
 
void net_arp_shutdown (void)
 Shutdown ARP. More...
 
int net_arp_insert (netif_t *nif, const uint8 mac[6], const uint8 ip[4], uint32 timestamp)
 Add an entry to the ARP cache manually. More...
 
int net_arp_lookup (netif_t *nif, const uint8 ip_in[4], uint8 mac_out[6], const ip_hdr_t *pkt, const uint8 *data, int data_size)
 Look up an entry from the ARP cache. More...
 
int net_arp_revlookup (netif_t *nif, uint8 ip_out[4], const uint8 mac_in[6])
 Do a reverse ARP lookup. More...
 
int net_arp_input (netif_t *nif, const uint8 *pkt, int len)
 Receive an ARP packet and process it (called by net_input). More...
 
int net_arp_query (netif_t *nif, const uint8 ip[4])
 Generate an ARP who-has query on the given device. More...
 
int net_input (netif_t *device, const uint8 *data, int len)
 Device drivers should call this function to submit packets received in the background. More...
 
net_input_func net_input_set_target (net_input_func t)
 Setup a network input target. More...
 
int net_icmp_send_echo (netif_t *net, const uint8 ipaddr[4], uint16 ident, uint16 seq, const uint8 *data, size_t size)
 Send an ICMP Echo packet to the specified IP. More...
 
int net_icmp_send_dest_unreach (netif_t *net, uint8 code, const uint8 *msg)
 Send an ICMP Destination Unreachable packet in reply to the given message. More...
 
int net_icmp_send_time_exceeded (netif_t *net, uint8 code, const uint8 *msg)
 Send an ICMP Time Exceeded packet in reply to the given message. More...
 
net_ipv4_stats_t net_ipv4_get_stats (void)
 Retrieve statistics from the IPv4 layer. More...
 
uint32 net_ipv4_address (const uint8 addr[4])
 Create a 32-bit IP address, based on the individual numbers contained within the IP. More...
 
void net_ipv4_parse_address (uint32 addr, uint8 out[4])
 Parse an IP address that is packet into a uint32 into an array of the individual bytes. More...
 
int net_icmp6_send_echo (netif_t *net, const struct in6_addr *dst, uint16 ident, uint16 seq, const uint8 *data, size_t size)
 Send an ICMPv6 Echo (PING6) packet to the specified device. More...
 
int net_icmp6_send_nsol (netif_t *net, const struct in6_addr *dst, const struct in6_addr *target, int dupdet)
 Send a Neighbor Solicitation packet on the specified device. More...
 
int net_icmp6_send_nadv (netif_t *net, const struct in6_addr *dst, const struct in6_addr *target, int sol)
 Send a Neighbor Advertisement packet on the specified device. More...
 
int net_icmp6_send_rsol (netif_t *net)
 Send a Router Solicitation request on the specified interface. More...
 
int net_icmp6_send_dest_unreach (netif_t *net, uint8 code, const uint8 *ppkt, size_t psz)
 Send a destination unreachable packet on the specified interface. More...
 
int net_icmp6_send_time_exceeded (netif_t *net, uint8 code, const uint8 *ppkt, size_t psz)
 Send a time exceeded message on the specified interface. More...
 
int net_icmp6_send_param_prob (netif_t *net, uint8 code, uint32 ptr, const uint8 *ppkt, size_t psz)
 Send an ICMPv6 Parameter Problem about the given packet. More...
 
net_ipv6_stats_t net_ipv6_get_stats (void)
 Retrieve statistics from the IPv6 layer. More...
 
int net_ndp_init (void)
 Init NDP. More...
 
void net_ndp_shutdown (void)
 Shutdown NDP. More...
 
void net_ndp_gc (void)
 Garbage collect timed out NDP entries. This will be called periodically as NDP queries come in. More...
 
int net_ndp_insert (netif_t *nif, const uint8 mac[6], const struct in6_addr *ip, int unsol)
 Add an entry to the NDP cache. More...
 
int net_ndp_lookup (netif_t *net, const struct in6_addr *ip, uint8 mac_out[6], const ipv6_hdr_t *pkt, const uint8 *data, int data_size)
 Look up an entry from the NDP cache. More...
 
net_udp_stats_t net_udp_get_stats (void)
 Retrieve statistics from the UDP layer. More...
 
int net_udp_init (void)
 Init UDP. More...
 
void net_udp_shutdown (void)
 Shutdown UDP. More...
 
int net_tcp_init (void)
 Init TCP. More...
 
void net_tcp_shutdown (void)
 Shutdown TCP. More...
 
uint32 net_crc32le (const uint8 *data, int size)
 Calculate a "little-endian" CRC-32 over a block of data. More...
 
uint32 net_crc32be (const uint8 *data, int size)
 Calculate a "big-endian" CRC-32 over a block of data. More...
 
uint16 net_crc16ccitt (const uint8 *data, int size, uint16 start)
 Calculate a CRC16-CCITT over a block of data. More...
 
int net_multicast_add (const uint8 mac[6])
 Add a entry to our multicast list. More...
 
int net_multicast_del (const uint8 mac[6])
 Delete a entry from our multicast list. More...
 
int net_multicast_check (const uint8 mac[6])
 Check if an address is on the multicast list. More...
 
int net_multicast_init (void)
 Init multicast support. More...
 
void net_multicast_shutdown (void)
 Shutdown multicast support. More...
 
struct netif_list * net_get_if_list (void)
 Function to retrieve the interface list. More...
 
netif_tnet_set_default (netif_t *n)
 Set our default device to an arbitrary device. More...
 
int net_reg_device (netif_t *device)
 Register a network device. More...
 
int net_unreg_device (netif_t *device)
 Unregister a network device. More...
 
int net_init (void)
 Init network support. More...
 
void net_shutdown (void)
 Shutdown network support. More...
 

Variables

net_input_func net_input_target
 Where will input packets be routed? More...
 
net_echo_cb net_icmp_echo_cb
 Where will we handle possibly notifying the user of ping replies? More...
 
net6_echo_cb net_icmp6_echo_cb
 Where will we handle possibly notifying the user of ping replies? More...
 
struct netif_list net_if_list
 Interface list; note: do not manipulate directly! More...
 
netif_tnet_default_dev
 The default network device, used with sockets (read-only). More...
 

Detailed Description

Network support.

This file contains declarations related to networking support. KOS' built-in network stack supports UDP over IPv4, and to some degree has some basic IPv6 support as well. This will change over time, hopefully leaving us with full TCP and UDP support both over IPv4 and IPv6.

Author
Lawrence Sebald
Dan Potter

Macro Definition Documentation

#define ICMP6_DEST_UNREACH_ADDR_UNREACH   3

Address unreachable.

#define ICMP6_DEST_UNREACH_BAD_ROUTE   6

Bad route specified.

#define ICMP6_DEST_UNREACH_BEYOND_SCOPE   2

Gone beyond scope.

#define ICMP6_DEST_UNREACH_FAIL_EGRESS   5

Egress failure.

#define ICMP6_DEST_UNREACH_NO_ROUTE   0

No route available.

#define ICMP6_DEST_UNREACH_PORT_UNREACH   4

Port unreachable.

#define ICMP6_DEST_UNREACH_PROHIBITED   1

Access prohibited.

#define ICMP6_PARAM_PROB_BAD_HEADER   0

Malformed header.

#define ICMP6_PARAM_PROB_UNK_HEADER   1

Unknown header.

#define ICMP6_PARAM_PROB_UNK_OPTION   2

Unknown header option.

#define ICMP6_TIME_EXCEEDED_FRAGMENT   1

Reassembly time gone.

#define ICMP6_TIME_EXCEEDED_HOPS_EXC   0

Hops exceeded.

#define ICMP_PORT_UNREACHABLE   3

Port unreachable.

#define ICMP_PROTOCOL_UNREACHABLE   2

Protocol unreachable.

#define ICMP_REASSEMBLY_TIME_EXCEEDED   1

Reassembly time gone.

#define NETIF_BLOCK   1

Blocking is OK for Tx.

#define NETIF_NOBLOCK   0

Don't block for Tx.

#define NETIF_TX_AGAIN   -2

Retry Tx later.

#define NETIF_TX_ERROR   -1

Tx general error.

#define NETIF_TX_OK   0

Tx success.

Typedef Documentation

typedef struct ip_hdr_s ip_hdr_t

IPv4 Packet header.

typedef struct ipv6_hdr_s ipv6_hdr_t

IPv6 Packet header.

typedef void(* net6_echo_cb)(const struct in6_addr *ip, uint16 seq, uint64 delta_us, uint8 hlim, const uint8 *data, size_t len)

ICMPv6 echo reply callback type.

Parameters
ipThe IPv6 address the reply is from.
seqThe sequence number of the packet.
delta_usThe time difference, in microseconds.
hlimThe hop limit value in the packet.
dataAny data in the packet.
lenThe length of the data, in bytes.
typedef void(* net_echo_cb)(const uint8 *ip, uint16 seq, uint64 delta_us, uint8 ttl, const uint8 *data, size_t len)

ICMPv4 echo reply callback type.

Parameters
ipThe IPv4 address the reply is from.
seqThe sequence number of the packet.
delta_usThe time difference, in microseconds.
ttlThe TTL value in the packet.
dataAny data in the packet.
lenThe length of the data, in bytes.
typedef int(* net_input_func)(netif_t *nif, const uint8 *pkt, int len)

Network input callback type.

Parameters
nifThe network device in use.
pktThe packet received.
lenThe length of the packet, in bytes.
Returns
0 on success, <0 on failure.

IPv4 statistics structure.

This structure holds some basic statistics about the IPv4 layer of the stack, and can be retrieved with the appropriate function.

IPv6 statistics structure.

This structure holds some basic statistics about the IPv6 layer of the stack, and can be retrieved with the appropriate function.

UDP statistics structure.

This structure holds some basic statistics about the UDP layer of the stack, and can be retrieved with the appropriate function.

typedef struct knetif netif_t

Structure describing one usable network device.

Each usable network device should have one of these describing it. These must be registered to the network layer before the device is useable.

Function Documentation

int net_arp_init ( void  )

Init ARP.

Return values
0On success (no error conditions defined).
int net_arp_input ( netif_t nif,
const uint8 pkt,
int  len 
)

Receive an ARP packet and process it (called by net_input).

Parameters
nifThe network device in use.
pktThe packet received.
lenThe length of the packet.
Return values
0On success (no error conditions defined).
int net_arp_insert ( netif_t nif,
const uint8  mac[6],
const uint8  ip[4],
uint32  timestamp 
)

Add an entry to the ARP cache manually.

Parameters
nifThe network device in use.
macThe MAC address of the entry.
ipThe IPv4 address of the entry.
timestampThe entry's timestamp. Set to 0 for a permanent entry, otherwise set to jiffies.
Return values
0On success (no error conditions defined).
int net_arp_lookup ( netif_t nif,
const uint8  ip_in[4],
uint8  mac_out[6],
const ip_hdr_t pkt,
const uint8 data,
int  data_size 
)

Look up an entry from the ARP cache.

If no entry is found, then an ARP query will be sent and an error will be returned. If you specify a packet with the call, it will be sent when the reply comes in.

Parameters
nifThe network device in use.
ip_inThe IP address to lookup.
mac_outStorage for the MAC address, if found.
pktA simple IPv4 header, if you want to send one when a response comes in (if not found immediately).
dataPacket data to go with the header.
data_sizeThe size of data.
Return values
0On success.
-1A query is outstanding for that address.
-2Address not found, query generated.
int net_arp_query ( netif_t nif,
const uint8  ip[4] 
)

Generate an ARP who-has query on the given device.

Parameters
nifThe network device to use.
ipThe IP to query.
Return values
0On success (no error conditions defined).
int net_arp_revlookup ( netif_t nif,
uint8  ip_out[4],
const uint8  mac_in[6] 
)

Do a reverse ARP lookup.

This function looks for an IP for a given mac address; note that if this fails, you have no recourse.

Parameters
nifThe network device in use.
ip_outStorage for the IPv4 address.
mac_inThe MAC address to look up.
Return values
0On success.
-1On failure.
void net_arp_shutdown ( void  )

Shutdown ARP.

uint16 net_crc16ccitt ( const uint8 data,
int  size,
uint16  start 
)

Calculate a CRC16-CCITT over a block of data.

Parameters
dataThe data to calculate over.
sizeThe size of the data, in bytes.
startThe value to start with. This could be a previous return value from this function (if continuing a previous calculation) or some initial seed value (typically 0xFFFF or 0x0000).
Returns
The calculated CRC16-CCITT.
Note
Based on code found online at http://www.ccsinfo.com/forum/viewtopic.php?t=24977
uint32 net_crc32be ( const uint8 data,
int  size 
)

Calculate a "big-endian" CRC-32 over a block of data.

Parameters
dataThe data to calculate over.
sizeThe size of the data, in bytes.
Returns
The calculated CRC-32.
uint32 net_crc32le ( const uint8 data,
int  size 
)

Calculate a "little-endian" CRC-32 over a block of data.

Parameters
dataThe data to calculate over.
sizeThe size of the data, in bytes.
Returns
The calculated CRC-32.
struct netif_list* net_get_if_list ( void  )

Function to retrieve the interface list.

Do not manipulate what this returns to you!

Returns
The network interface list.
int net_icmp6_send_dest_unreach ( netif_t net,
uint8  code,
const uint8 ppkt,
size_t  psz 
)

Send a destination unreachable packet on the specified interface.

Parameters
netThe network device to use.
codeThe type of message this is.
ppktThe message that caused this error.
pszSize of the original message.
Returns
0 on success, <0 on failure.
int net_icmp6_send_echo ( netif_t net,
const struct in6_addr dst,
uint16  ident,
uint16  seq,
const uint8 data,
size_t  size 
)

Send an ICMPv6 Echo (PING6) packet to the specified device.

Parameters
netThe network device to use.
dstThe address to send to.
identA packet identifier.
seqA packet sequence number.
dataData to send with the packet.
sizeLength of the data, in bytes.
Returns
0 on success, <0 on failure.
int net_icmp6_send_nadv ( netif_t net,
const struct in6_addr dst,
const struct in6_addr target,
int  sol 
)

Send a Neighbor Advertisement packet on the specified device.

Parameters
netThe network device to use.
dstThe destination address.
targetThe target address.
sol1 if solicited, 0 otherwise.
Returns
0 on success, <0 on failure.
int net_icmp6_send_nsol ( netif_t net,
const struct in6_addr dst,
const struct in6_addr target,
int  dupdet 
)

Send a Neighbor Solicitation packet on the specified device.

Parameters
netThe network device to use.
dstThe destination address.
targetThe target address.
dupdet1 if this is for duplicate detection.
Returns
0 on success, <0 on failure.
int net_icmp6_send_param_prob ( netif_t net,
uint8  code,
uint32  ptr,
const uint8 ppkt,
size_t  psz 
)

Send an ICMPv6 Parameter Problem about the given packet.

Parameters
netThe network device to use.
codeThe error code.
ptrWhere in the packet is the error?
ppktThe message that caused the error.
pszSize of the original packet.
Returns
0 on success, <0 on failure.
int net_icmp6_send_rsol ( netif_t net)

Send a Router Solicitation request on the specified interface.

Parameters
netThe network device to use.
Returns
0 on success, <0 on failure.
int net_icmp6_send_time_exceeded ( netif_t net,
uint8  code,
const uint8 ppkt,
size_t  psz 
)

Send a time exceeded message on the specified interface.

Parameters
netThe network device to use.
codeThe error code.
ppktThe message that caused this error.
pszSize of the original packet.
Returns
0 on success, <0 on failure.
int net_icmp_send_dest_unreach ( netif_t net,
uint8  code,
const uint8 msg 
)

Send an ICMP Destination Unreachable packet in reply to the given message.

Parameters
netThe network device to use.
codeThe type of message this is.
msgThe message that caused this error.
Returns
0 on success, <0 on failure.
int net_icmp_send_echo ( netif_t net,
const uint8  ipaddr[4],
uint16  ident,
uint16  seq,
const uint8 data,
size_t  size 
)

Send an ICMP Echo packet to the specified IP.

Parameters
netThe network device to use.
ipaddrThe IPv4 address to send to.
identA packet identifier.
seqA packet sequence number.
dataData to send with the packet.
sizeThe size of the data to send.
Returns
0 on success, <0 on failure.
int net_icmp_send_time_exceeded ( netif_t net,
uint8  code,
const uint8 msg 
)

Send an ICMP Time Exceeded packet in reply to the given message.

Parameters
netThe network device to use.
codeThe type of message this is.
msgThe message that caused this error.
Returns
0 on success, <0 on failure.
int net_init ( void  )

Init network support.

Returns
0 on success, <0 on failure.
int net_input ( netif_t device,
const uint8 data,
int  len 
)

Device drivers should call this function to submit packets received in the background.

This function may or may not return immidiately but it won't take an infinitely long time (so it's safe to call inside interrupt handlers).

Parameters
deviceThe network device submitting packets.
dataThe packet to submit.
lenThe length of the packet, in bytes.
Returns
0 on success, <0 on failure.
net_input_func net_input_set_target ( net_input_func  t)

Setup a network input target.

Parameters
tThe new target callback.
Returns
The old target.
uint32 net_ipv4_address ( const uint8  addr[4])

Create a 32-bit IP address, based on the individual numbers contained within the IP.

Parameters
addrArray of IP address octets.
Returns
The address, in host byte order.
net_ipv4_stats_t net_ipv4_get_stats ( void  )

Retrieve statistics from the IPv4 layer.

Returns
The net_ipv4_stats_t structure.
void net_ipv4_parse_address ( uint32  addr,
uint8  out[4] 
)

Parse an IP address that is packet into a uint32 into an array of the individual bytes.

Parameters
addrThe full address, in host byte order.
outThe output buffer.
net_ipv6_stats_t net_ipv6_get_stats ( void  )

Retrieve statistics from the IPv6 layer.

Returns
The global IPv6 stats structure.
int net_multicast_add ( const uint8  mac[6])

Add a entry to our multicast list.

This function will auto-commit the multicast list to the network interface in the process.

Parameters
macThe MAC address to add.
Returns
0 on success, <0 on failure.
int net_multicast_check ( const uint8  mac[6])

Check if an address is on the multicast list.

Parameters
macThe MAC address to check for.
Return values
0The address is not in the list.
1The address is in the list.
-1On error.
int net_multicast_del ( const uint8  mac[6])

Delete a entry from our multicast list.

This function will auto-commit the multicast list to the network interface in the process.

Parameters
macThe MAC address to add.
Returns
0 on success, <0 on failure.
int net_multicast_init ( void  )

Init multicast support.

Returns
0 on success, !0 on error.
void net_multicast_shutdown ( void  )

Shutdown multicast support.

void net_ndp_gc ( void  )

Garbage collect timed out NDP entries. This will be called periodically as NDP queries come in.

int net_ndp_init ( void  )

Init NDP.

Return values
0On success (no error conditions defined).
int net_ndp_insert ( netif_t nif,
const uint8  mac[6],
const struct in6_addr ip,
int  unsol 
)

Add an entry to the NDP cache.

Parameters
nifThe network device in question.
macThe MAC address for the entry.
ipThe IPv6 address for the entry.
unsolWas this unsolicited?
Returns
0 on success, <0 on failure.
int net_ndp_lookup ( netif_t net,
const struct in6_addr ip,
uint8  mac_out[6],
const ipv6_hdr_t pkt,
const uint8 data,
int  data_size 
)

Look up an entry from the NDP cache.

If no entry is found, then an NDP query will be sent and an error will be returned. If you specify a packet with the call, it will be sent when the reply comes in.

Parameters
netThe network device to use.
ipThe IPv6 address to query.
mac_outStorage for the MAC address on success.
pktA simple IPv6 header, if you want to send a packet when a reply comes in.
dataAnything that comes after the header.
data_sizeThe size of data.
Returns
0 on success, <0 on failure.
void net_ndp_shutdown ( void  )

Shutdown NDP.

int net_reg_device ( netif_t device)

Register a network device.

Parameters
deviceThe device to register.
Returns
0 on success, <0 on failure.
netif_t* net_set_default ( netif_t n)

Set our default device to an arbitrary device.

Parameters
nThe device to set as default.
Returns
The old default device.
void net_shutdown ( void  )

Shutdown network support.

int net_tcp_init ( void  )

Init TCP.

Return values
0On success (no error conditions defined).
void net_tcp_shutdown ( void  )

Shutdown TCP.

net_udp_stats_t net_udp_get_stats ( void  )

Retrieve statistics from the UDP layer.

Returns
The global UDP stats struct.
int net_udp_init ( void  )

Init UDP.

Return values
0On success (no error conditions defined).
void net_udp_shutdown ( void  )

Shutdown UDP.

int net_unreg_device ( netif_t device)

Unregister a network device.

Parameters
deviceThe device to unregister.
Returns
0 on success, <0 on failure.

Variable Documentation

netif_t* net_default_dev

The default network device, used with sockets (read-only).

net6_echo_cb net_icmp6_echo_cb

Where will we handle possibly notifying the user of ping replies?

net_echo_cb net_icmp_echo_cb

Where will we handle possibly notifying the user of ping replies?

struct netif_list net_if_list

Interface list; note: do not manipulate directly!

net_input_func net_input_target

Where will input packets be routed?