net_if.h File Reference

#include "nip_init.h"
#include "mem.h"
#include "os_core.h"

Include dependency graph for net_if.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  nip_net_if_trans_params_t
struct  nip_net_if_trans_flags_t
 flags to define transmission behavior. More...
struct  nip_net_if_trans_t
 Network Interface transmission. More...
struct  nip_net_if_stats_t
 Network Interface statistics. More...
struct  nip_phy_if_t
 Physical layer driver interface. More...
struct  nip_if_ip_conf
 Network Interface IP configuration. More...
struct  nip_net_if
 Network Interface. More...

Defines

#define NIP_NET_IF_COUNT   1
 Define number of Network Interfaces.
#define NIP_NET_IF_TRANS_COUNT   2
 Define maximum number of queued transmissions per interface Defaults to 2.
#define NIP_NET_MAX_TRANSMISSIONS   NIP_NET_IF_TRANS_COUNT
#define NIP_MAX_HW_ADDR_SIZE   6
 Define maximum hardware address size.
#define NIP_MAX_NET_ADDR_SIZE   4
 Define maximum network address size.
#define NIP_NET_LOOPBACK_ENABLE   1
 Enable local loopback of network packages.
#define NIP_NET_NULL_TRANSMISSION   NIP_NET_MAX_TRANSMISSIONS
 to be used as NULL indicator on transmission ids
#define NIP_NET_NO_IF   0xFF
#define NIP_IP_ADDR(if_id)   nip_net_if_list[if_id].ip_conf.addr
Physical Interface Flags
Interface flags (IFF) are used to influence the behavior of network interfaces.

Warning:
The flags should be set using the nip_set_if_flags function and may not be altered directly, as that might not be noticed by the interface.


#define NIP_PHY_IFF_UP   0x01
 Interface is active and ready to transfer packets.
#define NIP_PHY_IFF_BROADCAST   0x02
 Interface allows broadasting.
#define NIP_PHY_IFF_MULTICAST   0x04
 Interface allows multicasting.
#define NIP_PHY_IFF_NOARP   0x08
 Interface does not use ARP.
#define NIP_PHY_IFF_LOOPBACK   0x10
 Interface does local loopback.
#define NIP_PHY_IFF_CNT_OVW   0x20
 Interface should count receive buffer overruns.
#define NIP_PHY_IFF_CNT_RXE   0x40
 Interface should count receive errors.
#define NIP_PHY_IFF_CNT_TXE   0x80
 Interface should count transmit errors.
Macros for Interface statistics
#define NIP_PHY_LOG_OVW(net_if_ptr)
 Macro to count receive buffer overruns.
#define NIP_PHY_LOG_RXE(net_if_ptr)
 Macro to count receive errors.
#define NIP_PHY_LOG_TXE(net_if_ptr)
 Macro to count transmit errors.

Typedefs

typedef uint8_t nip_net_trans_id_t
typedef uint8_t nip_net_if_id_t
typedef uint8_t nip_phy_if_flags_t
 Type to be used when referencing IFFs.
typedef uint16_t nip_net_stats_cnt_t
typedef struct nip_if_ip_conf nip_if_ip_conf_t
typedef struct nip_net_if nip_net_if_t

Enumerations

enum  nip_net_trans_status_t {
  NIP_NET_IF_IDLE, NIP_NET_IF_RECEIVING, NIP_NET_IF_ROUTE, NIP_NET_IF_ROUTING,
  NIP_NET_IF_ROUTED, NIP_NET_IF_RESOLV_ADDR, NIP_NET_IF_RTS, NIP_NET_IF_SENDING,
  NIP_NET_IF_SEND_HNF, NIP_NET_IF_SEND_NRT, NIP_NET_IF_DONE
}
 Network Interface status. More...
enum  nip_phy_if_type_t { NIP_PHY_IF_OTHER, NIP_PHY_IF_ETH = 1 }
 Physical layer interface types. More...
enum  nip_if_ip_conf_stat_t { NIP_IP_CONF_STAT_UNCONFIGURED = 0, NIP_IP_CONF_STAT_CONFIGURED }

Functions

nip_net_if_id_t nip_net_if_create (nip_phy_if_type_t type)
void nip_net_if_free (nip_net_if_id_t id)
nip_success_t nip_set_if_flags (nip_net_if_id_t id, nip_phy_if_flags_t flags)
nip_net_if_tnip_net_if_ptr (nip_net_if_id_t)
nip_success_t nip_net_if_up (nip_net_if_id_t)
nip_success_t nip_net_if_down (nip_net_if_id_t)
void nip_reset_trans (nip_net_if_trans_t *trans)

Variables

nip_net_if_t nip_net_if_list []
nip_net_if_trans_t nip_net_trans_list []


Detailed Description

Todo:
remove Physical Interface function typedefs, if code works without these typedefs

Definition in file net_if.h.


Define Documentation

#define NIP_IP_ADDR ( if_id   )     nip_net_if_list[if_id].ip_conf.addr

Definition at line 405 of file net_if.h.

Referenced by nip_mdns_disp_check(), nip_mdns_init(), and nip_mdns_register_hostname().

#define NIP_MAX_HW_ADDR_SIZE   6

Define maximum hardware address size.

Defaults to 6 for ethernet addressing.

Definition at line 54 of file net_if.h.

#define NIP_MAX_NET_ADDR_SIZE   4

Define maximum network address size.

Defaults to 4 for ip addressing.

Definition at line 59 of file net_if.h.

#define NIP_NET_IF_COUNT   1

Define number of Network Interfaces.

Defaults to 1.

Definition at line 41 of file net_if.h.

Referenced by nip_init().

#define NIP_NET_IF_TRANS_COUNT   2

Define maximum number of queued transmissions per interface Defaults to 2.

Definition at line 47 of file net_if.h.

#define NIP_NET_LOOPBACK_ENABLE   1

Enable local loopback of network packages.

Definition at line 64 of file net_if.h.

#define NIP_NET_MAX_TRANSMISSIONS   NIP_NET_IF_TRANS_COUNT

Definition at line 50 of file net_if.h.

#define NIP_NET_NO_IF   0xFF

#define NIP_NET_NULL_TRANSMISSION   NIP_NET_MAX_TRANSMISSIONS

to be used as NULL indicator on transmission ids

Definition at line 68 of file net_if.h.

#define NIP_PHY_IFF_BROADCAST   0x02

Interface allows broadasting.

Definition at line 102 of file net_if.h.

Referenced by init_networking().

#define NIP_PHY_IFF_CNT_OVW   0x20

Interface should count receive buffer overruns.

Definition at line 106 of file net_if.h.

#define NIP_PHY_IFF_CNT_RXE   0x40

Interface should count receive errors.

Definition at line 107 of file net_if.h.

#define NIP_PHY_IFF_CNT_TXE   0x80

Interface should count transmit errors.

Definition at line 108 of file net_if.h.

#define NIP_PHY_IFF_LOOPBACK   0x10

Interface does local loopback.

Todo:
implement loopback!

Definition at line 105 of file net_if.h.

#define NIP_PHY_IFF_MULTICAST   0x04

Interface allows multicasting.

Definition at line 103 of file net_if.h.

Referenced by init_networking().

#define NIP_PHY_IFF_NOARP   0x08

Interface does not use ARP.

Hard_header method takes care of addressing.

Definition at line 104 of file net_if.h.

#define NIP_PHY_IFF_UP   0x01

Interface is active and ready to transfer packets.

Definition at line 101 of file net_if.h.

#define NIP_PHY_LOG_OVW ( net_if_ptr   ) 

Macro to count receive buffer overruns.

Definition at line 119 of file net_if.h.

#define NIP_PHY_LOG_RXE ( net_if_ptr   ) 

Macro to count receive errors.

Definition at line 126 of file net_if.h.

#define NIP_PHY_LOG_TXE ( net_if_ptr   ) 

Macro to count transmit errors.

Definition at line 133 of file net_if.h.


Typedef Documentation

typedef uint8_t nip_net_if_id_t

Definition at line 83 of file net_if.h.

typedef struct nip_net_if nip_net_if_t

typedef uint16_t nip_net_stats_cnt_t

Definition at line 256 of file net_if.h.

typedef uint8_t nip_net_trans_id_t

Definition at line 72 of file net_if.h.

typedef uint8_t nip_phy_if_flags_t

Type to be used when referencing IFFs.

Definition at line 140 of file net_if.h.


Enumeration Type Documentation

Enumerator:
NIP_IP_CONF_STAT_UNCONFIGURED 
NIP_IP_CONF_STAT_CONFIGURED 

Definition at line 366 of file net_if.h.

Network Interface status.

Enumerator:
NIP_NET_IF_IDLE  idle -- ready to send or receive data
NIP_NET_IF_RECEIVING  busy -- receiving data
NIP_NET_IF_ROUTE  transmission waiting to be routed
NIP_NET_IF_ROUTING  transmission busy routing
NIP_NET_IF_ROUTED  transmission has been routed
NIP_NET_IF_RESOLV_ADDR  waiting for hardware address to be resolved
NIP_NET_IF_RTS  ready to send, hardware address resolved
NIP_NET_IF_SENDING  busy -- sending data
NIP_NET_IF_SEND_HNF  sending data failed, Host not found, waiting to be unlocked.

NIP_NET_IF_SEND_NRT  sending data failed, No route to host, waiting to be unlocked.

NIP_NET_IF_DONE  sending/receiving data successful, waiting to be unlocked.

Definition at line 148 of file net_if.h.

Physical layer interface types.

Note:
Type numbers are taken from ARP section of "Assigned Numbers" RFC and may be used for various applications (ARP, DHCP,...).
Enumerator:
NIP_PHY_IF_OTHER  Other Network Interface.

Use this type if non of the below apply.

NIP_PHY_IF_ETH  Ethernet interface.

Definition at line 172 of file net_if.h.


Function Documentation

nip_net_if_id_t nip_net_if_create ( nip_phy_if_type_t  type  ) 

Referenced by init_networking().

Here is the caller graph for this function:

nip_success_t nip_net_if_down ( nip_net_if_id_t   ) 

void nip_net_if_free ( nip_net_if_id_t  id  ) 

nip_net_if_t* nip_net_if_ptr ( nip_net_if_id_t   ) 

Referenced by init_networking().

Here is the caller graph for this function:

nip_success_t nip_net_if_up ( nip_net_if_id_t   ) 

Referenced by init_networking().

Here is the caller graph for this function:

void nip_reset_trans ( nip_net_if_trans_t trans  ) 

Referenced by nip_tcp_disp_receive(), nip_tcp_disp_send(), and nip_udp_disp_receive().

Here is the caller graph for this function:

nip_success_t nip_set_if_flags ( nip_net_if_id_t  id,
nip_phy_if_flags_t  flags 
)

Referenced by init_networking().

Here is the caller graph for this function:


Variable Documentation


Generated on Thu Jul 10 01:09:46 2008 for NIP by  doxygen 1.5.5