[270] | 1 | /*
|
---|
| 2 | * TINET (TCP/IP Protocol Stack)
|
---|
| 3 | *
|
---|
| 4 | * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering
|
---|
| 5 | * Tomakomai National College of Technology, JAPAN
|
---|
| 6 | *
|
---|
| 7 | * 上記著作権者は,以下の (1)~(4) の条件か,Free Software Foundation
|
---|
| 8 | * によって公表されている GNU General Public License の Version 2 に記
|
---|
| 9 | * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
|
---|
| 10 | * を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
|
---|
| 11 | * 利用と呼ぶ)することを無償で許諾する.
|
---|
| 12 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
| 13 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
| 14 | * スコード中に含まれていること.
|
---|
| 15 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
| 16 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
| 17 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
| 18 | * の無保証規定を掲載すること.
|
---|
| 19 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
| 20 | * 用できない形で再配布する場合には,次の条件を満たすこと.
|
---|
| 21 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
| 22 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
| 23 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
| 24 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
| 25 | *
|
---|
| 26 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
| 27 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
|
---|
| 28 | * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
|
---|
| 29 | * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
|
---|
| 30 | *
|
---|
| 31 | * @(#) $Id$
|
---|
| 32 | */
|
---|
| 33 |
|
---|
| 34 | #ifndef _NETAPP_VAR_H_
|
---|
| 35 | #define _NETAPP_VAR_H_
|
---|
| 36 |
|
---|
| 37 | /*
|
---|
| 38 | * マクロ定義
|
---|
| 39 | */
|
---|
| 40 |
|
---|
| 41 | #if defined(SUPPORT_INET4)
|
---|
| 42 | #define T_IPEP T_IPV4EP
|
---|
| 43 | #endif
|
---|
| 44 |
|
---|
| 45 | #if defined(SUPPORT_INET6)
|
---|
| 46 | #define T_IPEP T_IPV6EP
|
---|
| 47 | #endif
|
---|
| 48 |
|
---|
| 49 | /*
|
---|
| 50 | * ネットワーク経由コンソール入出力
|
---|
| 51 | */
|
---|
| 52 |
|
---|
| 53 | #ifdef USE_NET_CONS
|
---|
| 54 |
|
---|
| 55 | /* リネーム */
|
---|
| 56 |
|
---|
| 57 | #define syslog net_syslog
|
---|
| 58 | #define serial_ctl_por net_serial_ctl_por
|
---|
| 59 |
|
---|
| 60 | /* 関数シミュレーションマクロ */
|
---|
| 61 |
|
---|
| 62 | #define FLUSH_SND_BUFF() flush_snd_buff()
|
---|
| 63 | #define WAI_NET_CONS_PRINTF() syscall(wai_sem(SEM_NET_CONS_PRINTF))
|
---|
| 64 | #define SIG_NET_CONS_PRINTF() sig_sem(SEM_NET_CONS_PRINTF)
|
---|
| 65 |
|
---|
| 66 | #else /* of #ifdef USE_NET_CONS */
|
---|
| 67 |
|
---|
| 68 | /* 関数シミュレーションマクロ */
|
---|
| 69 |
|
---|
| 70 | #define FLUSH_SND_BUFF()
|
---|
| 71 | #define WAI_NET_CONS_PRINTF()
|
---|
| 72 | #define SIG_NET_CONS_PRINTF()
|
---|
| 73 |
|
---|
| 74 | #endif /* of #ifdef USE_NET_CONS */
|
---|
| 75 |
|
---|
| 76 | /*
|
---|
| 77 | * 関数
|
---|
| 78 | */
|
---|
| 79 |
|
---|
| 80 | extern const char *in_strtfn (FN fncd);
|
---|
| 81 | extern const char *itron_strerror (ER ercd);
|
---|
| 82 | extern ER net_syslog(uint_t prio, const char *format, ...) throw();
|
---|
| 83 | extern ER net_serial_ctl_por(ID portid, uint_t ioctl) throw();
|
---|
| 84 | extern void flush_snd_buff (void);
|
---|
| 85 | extern ER discon_net_cons (void);
|
---|
| 86 | extern void wup_net_cons (void);
|
---|
| 87 | extern ER alloc_tcp_rep (ID *repid, ID tskid, T_TCP_CREP *crep);
|
---|
| 88 | extern ER free_tcp_rep (ID repid, bool_t call_tcp_del_rep);
|
---|
| 89 | extern ER alloc_tcp_cep (ID *cepid, ID tskid, T_TCP_CCEP *ccep);
|
---|
| 90 | extern ER free_tcp_cep (ID cepid);
|
---|
| 91 | extern ER alloc_udp_cep (ID *cepid, ID tskid, T_UDP_CCEP *ccep);
|
---|
| 92 | extern ER free_udp_cep (ID cepid, bool_t call_udp_del_cep);
|
---|
| 93 |
|
---|
| 94 | #if defined(SUPPORT_INET4)
|
---|
| 95 |
|
---|
| 96 | #define TCP_CRE_REP(i,r) tcp_cre_rep(i,r)
|
---|
| 97 | #define TCP_CRE_CEP(i,c) tcp_cre_cep(i,c)
|
---|
| 98 | #define UDP_CRE_CEP(i,c) udp_cre_cep(i,c)
|
---|
| 99 | #define TCP_ACP_CEP(c,r,d,t) tcp_acp_cep(c,r,d,t)
|
---|
| 100 | #define TCP_CON_CEP(c,m,d,t) tcp_con_cep(c,m,d,t)
|
---|
| 101 |
|
---|
| 102 | #define UDP_SND_DAT(c,d,b,l,t) udp_snd_dat(c,d,b,l,t)
|
---|
| 103 | #define UDP_RCV_DAT(c,d,b,l,t) udp_rcv_dat(c,d,b,l,t)
|
---|
| 104 |
|
---|
| 105 | #define IP2STR(s,a) ip2str(s,a)
|
---|
| 106 |
|
---|
| 107 | #define GET_IPADDR(a,l) get_ipv4addr(a,l)
|
---|
| 108 | #define PING(a,t,l) ping4(a,t,l)
|
---|
| 109 |
|
---|
| 110 | extern void ping4 (T_IN4_ADDR *addr, uint_t tmo, uint_t len);
|
---|
| 111 | extern char *get_ipv4addr (T_IN4_ADDR *addr, char *line);
|
---|
| 112 |
|
---|
| 113 | #endif /* of #if defined(SUPPORT_INET4) */
|
---|
| 114 |
|
---|
| 115 | #if defined(SUPPORT_INET6)
|
---|
| 116 |
|
---|
| 117 | #define TCP_CRE_REP(i,r) tcp6_cre_rep(i,r)
|
---|
| 118 | #define TCP_CRE_CEP(i,c) tcp6_cre_cep(i,c)
|
---|
| 119 | #define UDP_CRE_CEP(i,c) udp6_cre_cep(i,c)
|
---|
| 120 | #define TCP_ACP_CEP(c,r,d,t) tcp6_acp_cep(c,r,d,t)
|
---|
| 121 | #define TCP_CON_CEP(c,m,d,t) tcp6_con_cep(c,m,d,t)
|
---|
| 122 |
|
---|
| 123 | #define UDP_SND_DAT(c,d,b,l,t) udp6_snd_dat(c,d,b,l,t)
|
---|
| 124 | #define UDP_RCV_DAT(c,d,b,l,t) udp6_rcv_dat(c,d,b,l,t)
|
---|
| 125 |
|
---|
| 126 | #define IP2STR(s,a) ipv62str(s,a)
|
---|
| 127 |
|
---|
| 128 | #define GET_IPADDR(a,l) get_ipv6addr(a,l)
|
---|
| 129 | #define PING(a,t,l) ping6(a,t,l)
|
---|
| 130 |
|
---|
| 131 | extern void ping6 (T_IN6_ADDR *addr, uint_t tmo, uint_t len);
|
---|
| 132 | extern char *get_ipv6addr (T_IN6_ADDR *addr, char *line);
|
---|
| 133 |
|
---|
| 134 | #endif /* of #if defined(SUPPORT_INET6) */
|
---|
| 135 |
|
---|
| 136 | #endif /* of #ifndef _NETAPP_VAR_H_ */
|
---|