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

network.h

Go to the documentation of this file.
00001 /***
00002  * This file is part of OpenHome, an open source home automation system.
00003  * Copyright (C) 2003 Jan Klötzke
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  */
00019 
00020 
00027 #ifndef __NET_NET_H
00028 #define __NET_NET_H
00029 
00030 #include <inttypes.h>
00031 #include "net/buffers.h"
00032 
00033 // network address families
00034 #define NAF_LOGIC       0x00    
00035 #define NAF_GROUP       0x01    
00036 #define NAF_PHYSIC      0x02    
00037 #define NAF_BROADCAST   0x03    
00038 
00039 // address types
00040 #define AT_LOGIC        0x00    
00041 #define AT_PHYSIC       0x01    
00042 #define AT_GROUP0       0x02
00043 #define AT_GROUP1       0x03
00044 #define AT_GROUP2       0x04
00045 #define AT_GROUP3       0x05
00046 #define AT_GROUP4       0x06
00047 #define AT_GROUP5       0x07
00048 #define AT_GROUP6       0x08
00049 #define AT_GROUP7       0x09
00050 
00051 // network layer pdu types
00052 #define NPDU_SINGLE             0x00    
00053 #define NPDU_TRANSACTION        0x01    
00054 #define NPDU_SESSION            0x02    
00055 
00056 
00062 typedef struct {
00063                 uint8_t format;         
00064                 uint8_t addr[4];        
00065         } net_addr_t;
00066 
00072 typedef struct {
00073                 uint8_t pdu;            
00074                 uint8_t rat;            
00075                 net_addr_t src;         
00076         } net_ind_t;
00077 
00083 typedef struct {
00084                 net_addr_t dest;        
00085                 uint8_t src;            
00086                 uint8_t pdu;            
00087                 uint8_t backlog;        
00088         } net_requ_t;
00089 
00090 #ifdef __cplusplus
00091 extern "C" {
00092 #endif
00093 
00094 /***
00095  * global functions
00096  */
00097 uint8_t net_requ(net_buf_t *buf, const net_requ_t *requ);
00098 uint8_t net_compare_src_addr(const net_addr_t *addr1, const net_addr_t *addr2);
00099 uint8_t net_get_local_member_id(uint8_t group);
00100 uint8_t net_clear_to_send(void);
00101 void net_set_logic_addr(uint16_t addr);
00102 uint16_t net_get_logic_addr(void);
00103 void net_set_group_addr(uint8_t group, uint16_t addr);
00104 uint16_t net_get_group_addr(uint8_t group);
00105 
00106 #ifdef __cplusplus
00107 }
00108 #endif
00109 
00110 #endif

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