Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

network.h File Reference

Network layer include file. More...

#include <inttypes.h>
#include "net/buffers.h"

Go to the source code of this file.

Data Structures

struct  net_addr_t
 Network address structure. More...

struct  net_ind_t
 Network layer indication information. More...

struct  net_requ_t
 Network layer request block. More...


Defines

#define NAF_LOGIC   0x00
 Logic address.

#define NAF_GROUP   0x01
 Group address.

#define NAF_PHYSIC   0x02
 Physical address.

#define NAF_BROADCAST   0x03
 Broadcast.

#define AT_LOGIC   0x00
 Node's logical address.

#define AT_PHYSIC   0x01
 Node's physical address.

#define AT_GROUP0   0x02
#define AT_GROUP1   0x03
#define AT_GROUP2   0x04
#define AT_GROUP3   0x05
#define AT_GROUP4   0x06
#define AT_GROUP5   0x07
#define AT_GROUP6   0x08
#define AT_GROUP7   0x09
#define NPDU_SINGLE   0x00
 Single message.

#define NPDU_TRANSACTION   0x01
 Transaction.

#define NPDU_SESSION   0x02
 Session.


Functions

uint8_t net_requ (net_buf_t *buf, const net_requ_t *requ)
 Send a packet.

uint8_t net_compare_src_addr (const net_addr_t *addr1, const net_addr_t *addr2)
 Compares two source network addresses.

uint8_t net_get_local_member_id (uint8_t group)
 Returns local member number for a group.

uint8_t net_clear_to_send (void)
 Check if another packet can be scheduled for transmission.

void net_set_logic_addr (uint16_t addr)
 Set logic address.

uint16_t net_get_logic_addr (void)
 Get logic address.

void net_set_group_addr (uint8_t group, uint16_t addr)
 Set address of a group.

uint16_t net_get_group_addr (uint8_t group)
 Get group address.


Detailed Description

Network layer include file.

Constants and definitions of the network layer.

Definition in file network.h.


Function Documentation

uint8_t net_clear_to_send void   ) 
 

Check if another packet can be scheduled for transmission.

Returns:
Returns a nonzero value if a new packet could be passed to the network layer.

Definition at line 238 of file network.c.

References lnk_clear_to_send().

Referenced by tsp_process().

uint8_t net_compare_src_addr const net_addr_t addr1,
const net_addr_t addr2
 

Compares two source network addresses.

Since source and destination addresses differ in the group address format this function only compares two SOURCE network addresses.

Parameters:
addr1 First source address.
addr2 Second source address.
Returns:
One if the addresses match, otherwise zero.

Definition at line 210 of file network.c.

References net_addr_t::addr, and net_addr_t::format.

uint16_t net_get_group_addr uint8_t  group  ) 
 

Get group address.

Parameters:
group Number of group.
Returns:
Group node address.

Definition at line 280 of file network.c.

uint8_t net_get_local_member_id uint8_t  group  ) 
 

Returns local member number for a group.

Parameters:
group Group from which the node's member number should be returned. Use AT_GROUP* constants.
Returns:
Group member number.

Definition at line 227 of file network.c.

Referenced by net_ind().

uint16_t net_get_logic_addr void   ) 
 

Get logic address.

Returns:
Current logic address.

Definition at line 258 of file network.c.

uint8_t net_requ net_buf_t *  buf,
const net_requ_t requ
 

Send a packet.

This functions adds the network layer specific header and passes the packet to the link layer. Also checks if it should be delivered locally.

Parameters:
buf A network buffer containing the data to be sent. Must not be released until lnk_con() is called.
requ Structure containing network layer details such as the destination address.
Returns:
A nonzero value if the packet could be scheduled for delivery, otherwise zero.

Definition at line 162 of file network.c.

References net_addr_t::addr, AT_LOGIC, AT_PHYSIC, net_requ_t::backlog, net_requ_t::dest, net_addr_t::format, lnk_clear_to_send(), lnk_ind(), lnk_requ(), NAF_GROUP, NAF_LOGIC, NAF_PHYSIC, net_con(), net_requ_t::pdu, and net_requ_t::src.

Referenced by tsp_process().

void net_set_group_addr uint8_t  group,
uint16_t  addr
 

Set address of a group.

Parameters:
group Number of group which to set. [0..7]
addr Full qualified group node address.

Definition at line 269 of file network.c.

void net_set_logic_addr uint16_t  addr  ) 
 

Set logic address.

Parameters:
addr New logic address.

Definition at line 248 of file network.c.


Generated on Fri Oct 17 16:45:55 2003 for OpenHome by doxygen 1.3.3