[388] | 1 | /*
|
---|
| 2 | * TINET (TCP/IP Protocol Stack)
|
---|
| 3 | *
|
---|
| 4 | * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering
|
---|
| 5 | * Tomakomai National College of Technology, JAPAN
|
---|
| 6 | *
|
---|
| 7 | * ä¸è¨èä½æ¨©è
|
---|
| 8 | ã¯ï¼ä»¥ä¸ã® (1)ï½(4) ã®æ¡ä»¶ãï¼Free Software Foundation
|
---|
| 9 | * ã«ãã£ã¦å
|
---|
| 10 | ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨
|
---|
| 11 | * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢
|
---|
| 12 | * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé
|
---|
| 13 | å¸ï¼ä»¥ä¸ï¼
|
---|
| 14 | * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
| 15 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
| 16 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
| 17 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
| 18 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 19 | * ç¨ã§ããå½¢ã§åé
|
---|
| 20 | å¸ããå ´åã«ã¯ï¼åé
|
---|
| 21 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
| 22 | * è
|
---|
| 23 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
| 24 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 25 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 26 | * ç¨ã§ããªãå½¢ã§åé
|
---|
| 27 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®æ¡ä»¶ãæºãããã¨ï¼
|
---|
| 28 | * (a) åé
|
---|
| 29 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
| 30 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
| 31 | * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 32 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
| 33 | * 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 34 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
| 35 | 責ãããã¨ï¼
|
---|
| 36 | *
|
---|
| 37 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
| 38 | ã
|
---|
| 39 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã
|
---|
| 40 | * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´
|
---|
| 41 | * æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼
|
---|
| 42 | *
|
---|
| 43 | * @(#) $Id: udp_var.h 388 2019-05-22 11:25:18Z coas-nagasima $
|
---|
| 44 | */
|
---|
| 45 |
|
---|
| 46 | /*
|
---|
| 47 | * Copyright (c) 1982, 1986, 1989, 1993
|
---|
| 48 | * The Regents of the University of California. All rights reserved.
|
---|
| 49 | *
|
---|
| 50 | * Redistribution and use in source and binary forms, with or without
|
---|
| 51 | * modification, are permitted provided that the following conditions
|
---|
| 52 | * are met:
|
---|
| 53 | * 1. Redistributions of source code must retain the above copyright
|
---|
| 54 | * notice, this list of conditions and the following disclaimer.
|
---|
| 55 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
| 56 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 57 | * documentation and/or other materials provided with the distribution.
|
---|
| 58 | * 3. All advertising materials mentioning features or use of this software
|
---|
| 59 | * must display the following acknowledgement:
|
---|
| 60 | * This product includes software developed by the University of
|
---|
| 61 | * California, Berkeley and its contributors.
|
---|
| 62 | * 4. Neither the name of the University nor the names of its contributors
|
---|
| 63 | * may be used to endorse or promote products derived from this software
|
---|
| 64 | * without specific prior written permission.
|
---|
| 65 | *
|
---|
| 66 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
---|
| 67 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
---|
| 68 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
---|
| 69 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
---|
| 70 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
---|
| 71 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
---|
| 72 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
---|
| 73 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
---|
| 74 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
---|
| 75 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
| 76 | * SUCH DAMAGE.
|
---|
| 77 | *
|
---|
| 78 | * @(#)udp_var.h 8.1 (Berkeley) 6/10/93
|
---|
| 79 | * $FreeBSD: src/sys/netinet/udp_var.h,v 1.16.2.2 1999/08/29 16:29:59 peter Exp $
|
---|
| 80 | */
|
---|
| 81 |
|
---|
| 82 | #ifndef _UDP_VAR_H_
|
---|
| 83 | #define _UDP_VAR_H_
|
---|
| 84 |
|
---|
| 85 | /*
|
---|
| 86 | * UDP ãããã»ãã¤ãã¼ãã¢ã¯ã»ã¹ãã¯ã
|
---|
| 87 | */
|
---|
| 88 |
|
---|
| 89 | #define GET_UDP_HDR(nbuf,uhoff) ((T_UDP_HDR*)((uint8_t*)((nbuf)->buf) + uhoff))
|
---|
| 90 | #define GET_UDP_HDR_OFFSET(nbuf) (GET_IF_IP_HDR_SIZE(nbuf))
|
---|
| 91 | #define GET_UDP_SDU(nbuf,uhoff) ((uint8_t*)((nbuf)->buf) + uhoff+ UDP_HDR_SIZE)
|
---|
| 92 |
|
---|
| 93 | #define IF_IP_UDP_HDR_SIZE(nbuf) (IF_IP_HDR_SIZE(nbuf) + UDP_HDR_SIZE)
|
---|
| 94 | #define IF_IP_UDP_HDR_OFFSET(nbuf) (IF_IP_HDR_SIZE(nbuf))
|
---|
| 95 |
|
---|
| 96 | /*
|
---|
| 97 | * TINET 1.1 ã¨ã®äºææ§ã®ããã®å®ç¾©
|
---|
| 98 | */
|
---|
| 99 |
|
---|
| 100 | #if defined(_IP4_CFG)
|
---|
| 101 |
|
---|
| 102 | #define IP4_UDP_HDR_SIZE IP_UDP_HDR_SIZE
|
---|
| 103 | #define IF_IP4_UDP_HDR_SIZE IF_IP_UDP_HDR_SIZE
|
---|
| 104 | #define GET_IP4_UDP_HDR_SIZE(nbuf) GET_IP_UDP_HDR_SIZE(nbuf)
|
---|
| 105 | #define GET_IF_IP4_UDP_HDR_SIZE(nbuf) GET_IF_IP_UDP_HDR_SIZE(nbuf)
|
---|
| 106 |
|
---|
| 107 | #endif /* of #if defined(_IP4_CFG) */
|
---|
| 108 |
|
---|
| 109 | /*
|
---|
| 110 | * ã³ã¼ã«ããã¯é¢æ°ã®å®ç¾©
|
---|
| 111 | */
|
---|
| 112 |
|
---|
| 113 | typedef ER (*t_udp_callback)(ID cepid, FN fncd, void *p_parblk);
|
---|
| 114 |
|
---|
| 115 | typedef struct t_udp_rcv_dat_para {
|
---|
| 116 | uint_t len;
|
---|
| 117 | T_NET_BUF *input;
|
---|
| 118 | uint_t off;
|
---|
| 119 | union {
|
---|
| 120 | T_IPV4EP rep4;
|
---|
| 121 | T_IPV6EP rep6;
|
---|
| 122 | };
|
---|
| 123 | } T_UDP_RCV_DAT_PARA;
|
---|
| 124 |
|
---|
| 125 | /*
|
---|
| 126 | * UDP é信端ç¹
|
---|
| 127 | */
|
---|
| 128 |
|
---|
| 129 | /* IPv6 ç¨ UDP éä¿¡ç«¯ç¹ */
|
---|
| 130 |
|
---|
| 131 | typedef struct t_udp6_cep {
|
---|
| 132 |
|
---|
| 133 | /*
|
---|
| 134 | * ITRON TCP/IP APIãTCP é信端ç¹ã¨åãã¡ã³ã
|
---|
| 135 | */
|
---|
| 136 | ATR cepatr; /* UDP é信端ç¹å±æ§ */
|
---|
| 137 | T_IPV6EP myaddr; /* èªåã®ã¢ãã¬ã¹ */
|
---|
| 138 | t_udp_callback callback; /* ã³ã¼ã«ããã¯é¢æ° */
|
---|
| 139 |
|
---|
| 140 | /*
|
---|
| 141 | * TINET ç¬èªã®ã¡ã³ã
|
---|
| 142 | */
|
---|
| 143 | uint16_t flags; /* é信端ç¹ãã©ã° */
|
---|
| 144 | ID semid_lock; /* é信端ç¹ãã㯠*/
|
---|
| 145 | ID snd_tskid; /* éä¿¡ã¿ã¹ã¯èå¥å */
|
---|
| 146 | ID rcv_tskid; /* åä¿¡ã¿ã¹ã¯èå¥å */
|
---|
| 147 | ID rcvqid; /* éã³ã¼ã«ããã¯ç¨åä¿¡ãã¥ã¼èå¥å*/
|
---|
| 148 | T_NET_BUF *cb_netbuf; /* ã³ã¼ã«ããã¯ç¨åä¿¡ãããã¯ã¼ã¯ãããã¡*/
|
---|
| 149 |
|
---|
| 150 | #ifdef UDP_CFG_NON_BLOCKING
|
---|
| 151 |
|
---|
| 152 | T_IPV6EP *snd_p_dstaddr; /* éä¿¡ç¸æã®ã¢ãã¬ã¹ã¸ã®ãã¤ã³ã¿*/
|
---|
| 153 | T_IPV6EP *rcv_p_dstaddr; /* åä¿¡ç¸æã®ã¢ãã¬ã¹ã¸ã®ãã¤ã³ã¿*/
|
---|
| 154 | void *snd_data; /* éä¿¡ãã¼ã¿é åã®å
|
---|
| 155 | é ã¢ãã¬ã¹ */
|
---|
| 156 | int_t snd_len; /* éä¿¡ãã¼ã¿é åã®é·ã */
|
---|
| 157 | void *rcv_data; /* åä¿¡ãã¼ã¿é åã®å
|
---|
| 158 | é ã¢ãã¬ã¹ */
|
---|
| 159 | int_t rcv_len; /* åä¿¡ãã¼ã¿é åã®é·ã */
|
---|
| 160 |
|
---|
| 161 | #endif /* of #ifdef UDP_CFG_NON_BLOCKING */
|
---|
| 162 |
|
---|
| 163 | #ifdef UDP_CFG_EXTENTIONS
|
---|
| 164 | ER error; /* å¾
|
---|
| 165 | ã¡ä¸ã«çºçããã¨ã©ã¼ */
|
---|
| 166 | #endif
|
---|
| 167 |
|
---|
| 168 | #ifdef SUPPORT_IGMP
|
---|
| 169 | bool_t igmp_loopback;
|
---|
| 170 | uint8_t igmp_ttl;
|
---|
| 171 | T_IN4_ADDR igmp_mcaddr; /* */
|
---|
| 172 | #endif
|
---|
| 173 |
|
---|
| 174 | } T_UDP6_CEP;
|
---|
| 175 |
|
---|
| 176 | /* IPv4 ç¨ UDP éä¿¡ç«¯ç¹ */
|
---|
| 177 |
|
---|
| 178 | typedef struct t_udp4_cep {
|
---|
| 179 |
|
---|
| 180 | /*
|
---|
| 181 | * ITRON TCP/IP APIãTCP é信端ç¹ã¨åãã¡ã³ã
|
---|
| 182 | */
|
---|
| 183 | ATR cepatr; /* UDP é信端ç¹å±æ§ */
|
---|
| 184 | T_IPV4EP myaddr; /* èªåã®ã¢ãã¬ã¹ */
|
---|
| 185 | t_udp_callback callback; /* ã³ã¼ã«ããã¯é¢æ° */
|
---|
| 186 |
|
---|
| 187 | /*
|
---|
| 188 | * TINET ç¬èªã®ã¡ã³ã
|
---|
| 189 | */
|
---|
| 190 | uint16_t flags; /* é信端ç¹ãã©ã° */
|
---|
| 191 | ID semid_lock; /* é信端ç¹ãã㯠*/
|
---|
| 192 | ID snd_tskid; /* éä¿¡ã¿ã¹ã¯èå¥å */
|
---|
| 193 | ID rcv_tskid; /* åä¿¡ã¿ã¹ã¯èå¥å */
|
---|
| 194 | ID rcvqid; /* éã³ã¼ã«ããã¯ç¨åä¿¡ãã¥ã¼èå¥å*/
|
---|
| 195 | T_NET_BUF *cb_netbuf; /* ã³ã¼ã«ããã¯ç¨åä¿¡ãããã¯ã¼ã¯ãããã¡*/
|
---|
| 196 |
|
---|
| 197 | #ifdef UDP_CFG_NON_BLOCKING
|
---|
| 198 |
|
---|
| 199 | T_IPV4EP *snd_p_dstaddr; /* éä¿¡ç¸æã®ã¢ãã¬ã¹ã¸ã®ãã¤ã³ã¿*/
|
---|
| 200 | T_IPV4EP *rcv_p_dstaddr; /* åä¿¡ç¸æã®ã¢ãã¬ã¹ã¸ã®ãã¤ã³ã¿*/
|
---|
| 201 | void *snd_data; /* éä¿¡ãã¼ã¿é åã®å
|
---|
| 202 | é ã¢ãã¬ã¹ */
|
---|
| 203 | int_t snd_len; /* éä¿¡ãã¼ã¿é åã®é·ã */
|
---|
| 204 | void *rcv_data; /* åä¿¡ãã¼ã¿é åã®å
|
---|
| 205 | é ã¢ãã¬ã¹ */
|
---|
| 206 | int_t rcv_len; /* åä¿¡ãã¼ã¿é åã®é·ã */
|
---|
| 207 |
|
---|
| 208 | #endif /* of #ifdef UDP_CFG_NON_BLOCKING */
|
---|
| 209 |
|
---|
| 210 | #ifdef UDP_CFG_EXTENTIONS
|
---|
| 211 | ER error; /* å¾
|
---|
| 212 | ã¡ä¸ã«çºçããã¨ã©ã¼ */
|
---|
| 213 | #endif
|
---|
| 214 |
|
---|
| 215 | #ifdef SUPPORT_IGMP
|
---|
| 216 | bool_t igmp_loopback;
|
---|
| 217 | uint8_t igmp_ttl;
|
---|
| 218 | T_IN4_ADDR igmp_mcaddr; /* */
|
---|
| 219 | #endif
|
---|
| 220 |
|
---|
| 221 | } T_UDP4_CEP;
|
---|
| 222 |
|
---|
| 223 | #if defined(_IP6_CFG)
|
---|
| 224 |
|
---|
| 225 | #define T_UDP_CEP T_UDP6_CEP
|
---|
| 226 |
|
---|
| 227 | #else /* of #if defined(_IP6_CFG) */
|
---|
| 228 |
|
---|
| 229 | #if defined(_IP4_CFG)
|
---|
| 230 |
|
---|
| 231 | #define T_UDP_CEP T_UDP4_CEP
|
---|
| 232 |
|
---|
| 233 | #endif /* of #if defined(_IP4_CFG) */
|
---|
| 234 |
|
---|
| 235 | #endif /* of #if defined(_IP6_CFG) */
|
---|
| 236 |
|
---|
| 237 | /*
|
---|
| 238 | * UDP é信端ç¹ãã©ã°
|
---|
| 239 | */
|
---|
| 240 |
|
---|
| 241 | #define UDP_CEP_FLG_POST_OUTPUT UINT_C(0x0200) /* éä¿¡ãéå§ããã */
|
---|
| 242 | #define UDP_CEP_FLG_DYNAMIC UINT_C(0x0400) /* åççæã»åé¤å¯è½é信端ç¹ã */
|
---|
| 243 | #define UDP_CEP_FLG_VALID UINT_C(0x0800) /* çææ¸ã¿ã§æå¹ãªé信端ç¹ã */
|
---|
| 244 |
|
---|
| 245 | /*
|
---|
| 246 | * ãªãã¸ã§ã¯ã ID ã®æå°å¤ã®å®ç¾©
|
---|
| 247 | */
|
---|
| 248 |
|
---|
| 249 | #define TMIN_UDP_CEPID 1 /* UDP éä¿¡ç«¯ç¹ ID ã®æå°å¤ */
|
---|
| 250 | #define TMIN_UDP6_CEPID 1 /* UDP/IPv6 éä¿¡ç«¯ç¹ ID ã®æå°å¤ */
|
---|
| 251 | #define TMIN_UDP4_CEPID (TNUM_UDP6_CEPID+1) /* UDP/IPv4 éä¿¡ç«¯ç¹ ID ã®æå°å¤ */
|
---|
| 252 |
|
---|
| 253 | /*
|
---|
| 254 | * SNMP 㮠管çæ
|
---|
| 255 | å ±ãã¼ã¹ (MIB)
|
---|
| 256 | */
|
---|
| 257 |
|
---|
| 258 | typedef struct t_udp_stats {
|
---|
| 259 | uint32_t udpInDatagrams;
|
---|
| 260 | uint32_t udpNoPorts;
|
---|
| 261 | uint32_t udpInErrors;
|
---|
| 262 | uint32_t udpOutDatagrams;
|
---|
| 263 | } T_UDP_STATS;
|
---|
| 264 |
|
---|
| 265 | /*
|
---|
| 266 | * é¢æ°ã·ãã¥ã¬ã¼ã·ã§ã³ãã¯ã
|
---|
| 267 | */
|
---|
| 268 |
|
---|
| 269 | #define VALID_UDP6_CEPID(id) (TMIN_UDP6_CEPID<=(id)&&(id)<=tmax_udp6_cepid)
|
---|
| 270 | #define VALID_UDP4_CEPID(id) (TMIN_UDP4_CEPID<=(id)&&(id)<=tmax_udp4_cepid)
|
---|
| 271 |
|
---|
| 272 | #define INDEX_UDP6_CEP(id) ((id)-TMIN_UDP6_CEPID)
|
---|
| 273 | #define INDEX_UDP4_CEP(id) ((id)-TMIN_UDP4_CEPID)
|
---|
| 274 |
|
---|
| 275 | #define GET_UDP6_CEP(id) (&(udp6_cep[INDEX_UDP6_CEP(id)]))
|
---|
| 276 | #define GET_UDP4_CEP(id) (&(udp4_cep[INDEX_UDP4_CEP(id)]))
|
---|
| 277 |
|
---|
| 278 | #define GET_UDP6_CEPID(cep) ((ID)(((cep)-udp6_cep)+TMIN_UDP6_CEPID))
|
---|
| 279 | #define GET_UDP4_CEPID(cep) ((ID)(((cep)-udp4_cep)+TMIN_UDP4_CEPID))
|
---|
| 280 |
|
---|
| 281 | #define VALID_TFN_UDP_CAN(t) ((t)==TFN_UDP_SND_DAT||(t)==TFN_UDP_RCV_DAT||\
|
---|
| 282 | (t)==TFN_UDP_ALL)
|
---|
| 283 |
|
---|
| 284 | #define VALID_UDP_CEP(cep) (((cep)->flags&UDP_CEP_FLG_VALID)!=0)
|
---|
| 285 | #define DYNAMIC_UDP_CEP(cep) (((cep)->flags&UDP_CEP_FLG_DYNAMIC)!=0)
|
---|
| 286 |
|
---|
| 287 | /*
|
---|
| 288 | * å
|
---|
| 289 | ¨åå¤æ°
|
---|
| 290 | */
|
---|
| 291 |
|
---|
| 292 | extern T_UDP_STATS udp_stats;
|
---|
| 293 |
|
---|
| 294 | /* UDP éä¿¡ç«¯ç¹ */
|
---|
| 295 |
|
---|
| 296 | extern T_UDP6_CEP udp6_cep[];
|
---|
| 297 | extern T_UDP4_CEP udp4_cep[];
|
---|
| 298 |
|
---|
| 299 | #if defined(SUPPORT_INET6)
|
---|
| 300 | #define udp_cep udp6_cep
|
---|
| 301 | #elif defined(SUPPORT_INET4)
|
---|
| 302 | #define udp_cep udp4_cep
|
---|
| 303 | #endif
|
---|
| 304 |
|
---|
| 305 | extern const ID tmax_udp_cepid;
|
---|
| 306 |
|
---|
| 307 | #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4)
|
---|
| 308 | extern const ID tmax_udp6_cepid;
|
---|
| 309 | extern const ID tmax_udp4_cepid;
|
---|
| 310 | #else
|
---|
| 311 | #define tmax_udp6_cepid tmax_udp_cepid
|
---|
| 312 | #define tmax_udp4_cepid tmax_udp_cepid
|
---|
| 313 | #endif
|
---|
| 314 |
|
---|
| 315 | /*
|
---|
| 316 | * TINET 1.3 ã¨ã®äºææ§ã®ããã®å®ç¾©
|
---|
| 317 | */
|
---|
| 318 |
|
---|
| 319 | #define TMIN_UDP_CCEPID TMIN_UDP_CEPID
|
---|
| 320 | #define TNUM_UDP_CCEPID TNUM_UDP_CEPID
|
---|
| 321 |
|
---|
| 322 | /*
|
---|
| 323 | * é¢æ°
|
---|
| 324 | */
|
---|
| 325 |
|
---|
| 326 | /* IPv6 */
|
---|
| 327 |
|
---|
| 328 | extern uint_t udp6_input (T_NET_BUF **inputp, uint_t *offp, uint_t *nextp);
|
---|
| 329 | extern ER_UINT udp6_send_data (T_UDP6_CEP *cep, T_IPV6EP *p_dstaddr,
|
---|
| 330 | void *data, int_t len, TMO tmout);
|
---|
| 331 | extern ER udp6_can_snd (T_UDP6_CEP *cep, ER error);
|
---|
| 332 | extern ER udp6_can_rcv (T_UDP6_CEP *cep, ER error);
|
---|
| 333 | extern ER udp6_alloc_auto_port (T_UDP6_CEP *cep);
|
---|
| 334 | extern ER udp6_alloc_port (T_UDP6_CEP *cep, uint16_t portno);
|
---|
| 335 | extern T_UDP6_CEP*udp6_find_cep (T_NET_BUF *input, uint_t off);
|
---|
| 336 | extern void udp6_notify (T_NET_BUF *input, ER error);
|
---|
| 337 | extern void udp6_input_select (T_UDP6_CEP *cep, T_NET_BUF *input, uint_t off);
|
---|
| 338 |
|
---|
| 339 | /* IPv4 */
|
---|
| 340 |
|
---|
| 341 | extern uint_t udp4_input (T_NET_BUF **inputp, uint_t *offp, uint_t *nextp);
|
---|
| 342 | extern ER_UINT udp4_send_data (T_UDP4_CEP *cep, T_IPV4EP *p_dstaddr,
|
---|
| 343 | void *data, int_t len, TMO tmout);
|
---|
| 344 | extern ER udp4_can_snd (T_UDP4_CEP *cep, ER error);
|
---|
| 345 | extern ER udp4_can_rcv (T_UDP4_CEP *cep, ER error);
|
---|
| 346 | extern ER udp4_alloc_auto_port (T_UDP4_CEP *cep);
|
---|
| 347 | extern ER udp4_alloc_port (T_UDP4_CEP *cep, uint16_t portno);
|
---|
| 348 | extern T_UDP4_CEP*udp4_find_cep (T_NET_BUF *input, uint_t off);
|
---|
| 349 | extern void udp4_notify (T_NET_BUF *input, ER error);
|
---|
| 350 | extern void udp4_input_select (T_UDP4_CEP *cep, T_NET_BUF *input, uint_t off);
|
---|
| 351 |
|
---|
| 352 | /* ãã³ããããã³ã°ã³ã¼ã«ãè¡ãå ´åã«çµã¿è¾¼ãã¿ã¹ã¯ */
|
---|
| 353 |
|
---|
| 354 | extern void udp_output_task(intptr_t exinf);
|
---|
| 355 |
|
---|
| 356 | #endif /* of #ifndef _UDP_VAR_H_ */
|
---|