source: EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/in_subr.c@ 270

Last change on this file since 270 was 270, checked in by coas-nagasima, 7 years ago

mruby版ECNLプロトタイピング・ツールを追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-csrc
File size: 17.4 KB
Line 
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 * 上記著作権者
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: in_subr.c 270 2017-02-09 04:03:47Z coas-nagasima $
44 */
45
46/*
47 * Copyright (c) 1982, 1986, 1988, 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
79#include <string.h>
80
81#ifdef TARGET_KERNEL_ASP
82
83#include <kernel.h>
84#include <sil.h>
85#include <t_syslog.h>
86#include "kernel_cfg.h"
87
88#endif /* of #ifdef TARGET_KERNEL_ASP */
89
90#ifdef TARGET_KERNEL_JSP
91
92#include <s_services.h>
93#include <t_services.h>
94#include "kernel_id.h"
95
96#endif /* of #ifdef TARGET_KERNEL_JSP */
97
98#include <tinet_defs.h>
99#include <tinet_config.h>
100
101#include <net/if.h>
102#include <net/if_loop.h>
103#include <net/if_ppp.h>
104#include <net/ethernet.h>
105#include <net/ppp_ipcp.h>
106#include <net/net.h>
107#include <net/net_var.h>
108#include <net/net_buf.h>
109#include <net/net_timer.h>
110
111#include <netinet/in.h>
112#include <netinet6/in6.h>
113#include <netinet/in_var.h>
114#include <netinet/in_itron.h>
115#include <netinet/ip.h>
116#include <netinet/ip_var.h>
117#include <netinet/tcp_timer.h>
118
119#include <net/if_var.h>
120
121#if defined(SUPPORT_INET4)
122
123/*
124 * in4_get_ifaddr -- インタフェースに設定されているアドレスを返す。
125 */
126
127const T_IN4_ADDR *
128in4_get_ifaddr (int_t index)
129{
130 T_IFNET *ifp = IF_GET_IFNET();
131
132 return &ifp->in_ifaddr.addr;
133 }
134
135/*
136 * ip2str -- IPv4 アドレスを文字列に変換する。
137 */
138
139char *
140ip2str (char *buf, const T_IN4_ADDR *ipaddr)
141{
142 static char addr_sbuf[NUM_IPV4ADDR_STR_BUFF][sizeof("123.123.123.123")];
143 static int_t bix = NUM_IPV4ADDR_STR_BUFF;
144
145 char *start;
146
147 if (buf == NULL) {
148 syscall(wai_sem(SEM_IP2STR_BUFF_LOCK));
149 buf = addr_sbuf[-- bix];
150 if (bix <= 0)
151 bix = NUM_IPV4ADDR_STR_BUFF;
152 syscall(sig_sem(SEM_IP2STR_BUFF_LOCK));
153 }
154
155 start = buf;
156 buf += convert_hexdigit(buf, (uint_t)((*ipaddr >> 24) & 0xff), 10, 0, ' ');
157 *(buf ++) = '.';
158 buf += convert_hexdigit(buf, (uint_t)((*ipaddr >> 16) & 0xff), 10, 0, ' ');
159 *(buf ++) = '.';
160 buf += convert_hexdigit(buf, (uint_t)((*ipaddr >> 8) & 0xff), 10, 0, ' ');
161 *(buf ++) = '.';
162 buf += convert_hexdigit(buf, (uint_t)((*ipaddr ) & 0xff), 10, 0, ' ');
163 *buf = '\0';
164 return start;
165 }
166
167/*
168 * in4_set_header -- IPv4 ヘッダを設定する。
169 */
170
171ER
172in4_set_header (T_NET_BUF *nbuf, uint_t len,
173 T_IN4_ADDR *dstaddr, T_IN4_ADDR *srcaddr, uint8_t proto, uint8_t ttl)
174{
175 T_IP4_HDR *ip4h = GET_IP4_HDR(nbuf);
176 T_IFNET *ifp = IF_GET_IFNET();
177
178 /* IP ヘッダを設定する。*/
179 ip4h->vhl = IP4_MAKE_VHL(IPV4_VERSION, IP4_HDR_SIZE >> 2);
180 ip4h->len = htons(IP4_HDR_SIZE + len);
181 ip4h->proto = proto;
182 ip4h->ttl = ttl;
183 ip4h->type = 0;
184 ip4h->id = ip4h->flg_off = ip4h->sum = 0;
185
186 /* IP アドレスを設定する。*/
187 ip4h->dst = htonl(*dstaddr);
188
189 if (srcaddr == NULL || *srcaddr == IPV4_ADDRANY)
190 ip4h->src = htonl(ifp->in_ifaddr.addr);
191 else
192 ip4h->src = htonl(*srcaddr);
193
194 return E_OK;
195 }
196
197/*
198 * in4_get_datagram -- IPv4 データグラムを獲得し、ヘッダを設定する。
199 */
200
201ER
202in4_get_datagram (T_NET_BUF **nbuf, uint_t len, uint_t maxlen,
203 T_IN4_ADDR *dstaddr, T_IN4_ADDR *srcaddr,
204 uint8_t proto, uint8_t ttl, ATR nbatr, TMO tmout)
205{
206 ER error;
207 uint_t align;
208
209 /* データ長を 4 オクテット境界に調整する。*/
210 align = (len + 3) >> 2 << 2;
211
212 /* ネットワークバッファを獲得する。*/
213 if ((error = tget_net_buf_ex(nbuf, (uint_t)(IF_IP4_HDR_SIZE + align),
214 (uint_t)(IF_IP4_HDR_SIZE + maxlen), nbatr, tmout)) != E_OK)
215 return error;
216
217 /*
218 * より大きなサイズのネットワークバッファを獲得する場合のみ長さを調整する。
219 * より小さなサイズのネットワークバッファの獲得は、送信ウィンドバッファの
220 * 省コピー機能で使用され、実際に送信するまで、データサイズは決定できない。
221 */
222 if ((nbatr & NBA_SEARCH_ASCENT) != 0)
223 (*nbuf)->len = (uint16_t)(IF_IP4_HDR_SIZE + len);
224
225 /* IP ヘッダを設定する。*/
226 if ((error = in4_set_header(*nbuf, len, dstaddr, srcaddr, proto, ttl)) != E_OK)
227 return error;
228
229 /* 4 オクテット境界までパディングで埋める。*/
230 if (align > len)
231 memset((GET_IP4_SDU(*nbuf) + len), 0, (size_t)(align - len));
232
233 return E_OK;
234 }
235
236/*
237 * in4_cksum -- IPv4 のトランスポート層ヘッダのチェックサムを計算する。
238 *
239 * 注意: 戻り値はネットワークバイトオーダ
240 */
241
242uint16_t
243in4_cksum (T_NET_BUF *nbuf, uint8_t proto, uint_t off, uint_t len)
244{
245 uint32_t sum;
246 uint_t align;
247
248 /* 4 オクテット境界のデータ長 */
249 align = (len + 3) >> 2 << 2;
250
251 /* 4 オクテット境界までパディングで埋める。*/
252 if (align > len)
253 memset((uint8_t*)nbuf->buf + off + len, 0, (size_t)(align - len));
254
255 sum = in_cksum_sum(nbuf->buf + off, align)
256 + in_cksum_sum(&GET_IP4_HDR(nbuf)->src, sizeof(T_IN4_ADDR) * 2)
257 + len + proto;
258 sum = in_cksum_carry(sum);
259
260 return (uint16_t)(~htons((uint16_t)sum));
261 }
262
263/*
264 * in_cksum -- チェックサム計算関数、IPv4、ICMPv4 用
265 *
266 * 注意: data は 4 オクテット単位でパディングすること。
267 * data が 2 オクテット単位にアラインされていないと
268 * 例外が発生する可能性がある。
269 * len は 4 オクテット単位にアラインされていること。
270 *
271 * 戻り値はネットワークバイトオーダ
272 */
273
274uint16_t
275in_cksum (void *data, uint_t len /*オクテット単位*/)
276{
277 uint16_t sum;
278
279 sum = (uint16_t)in_cksum_carry(in_cksum_sum(data, len));
280 return (uint16_t)(~htons(sum));
281 }
282
283/*
284 * in4_is_dstaddr_accept -- 宛å…
285ˆã‚¢ãƒ‰ãƒ¬ã‚¹ã¨ã—て正しいかチェックする。
286 *
287 * 注意: dstaddr は、
288 * TINET-1.2 からネットワークバイトオーダ、
289 * TINET-1.1 までは、ホストバイトオーダ
290 */
291
292bool_t
293in4_is_dstaddr_accept (T_IN4_ADDR *myaddr, T_IN4_ADDR *dstaddr)
294{
295 if (*myaddr == IPV4_ADDRANY)
296 return ntohl(*dstaddr) == IF_GET_IFNET()->in_ifaddr.addr;
297 else
298 return ntohl(*dstaddr) == *myaddr;
299 }
300
301/*
302 * in4_ifawithifp -- 宛å…
303ˆã‚¢ãƒ‰ãƒ¬ã‚¹ã«ãµã•ã‚ã—い送信å…
304ƒã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’、
305 * ネットワークインタフェースから探索する。
306 * in6_ifawithifp をシミュレートするだけで、
307 * エラーを返すことはない。
308 */
309
310T_IN4_IFADDR *
311in4_ifawithifp (T_IFNET *ifp, T_IN4_ADDR *dst)
312{
313 return &ifp->in_ifaddr;
314 }
315
316/*
317 * in4_add_ifaddr -- インタフェースに IPv4 アドレスを設定する。
318 */
319
320ER
321in4_add_ifaddr (T_IN4_ADDR addr, T_IN4_ADDR mask)
322{
323 T_IFNET *ifp = IF_GET_IFNET();
324
325 ifp->in_ifaddr.addr = addr;
326 ifp->in_ifaddr.mask = mask;
327 return E_OK;
328 }
329
330#if NUM_ROUTE_ENTRY > 0
331
332/*
333 * in4_add_route -- 経路表にエントリを設定する。
334 */
335
336ER
337in4_add_route (int_t index, T_IN4_ADDR target, T_IN4_ADDR mask, T_IN4_ADDR gateway)
338{
339
340 if (0 <= index && index < NUM_STATIC_ROUTE_ENTRY) {
341 routing_tbl[index].target = target;
342 routing_tbl[index].mask = mask;
343 routing_tbl[index].gateway = gateway;
344 return E_OK;
345 }
346 else
347 return E_PAR;
348 }
349
350#endif /* of #if NUM_ROUTE_ENTRY > 0 */
351
352/*
353 * in4_rtalloc -- ルーティング表を探索する。
354 */
355
356T_IN4_ADDR
357in4_rtalloc (T_IN4_ADDR dst)
358{
359 int_t ix;
360
361 for (ix = NUM_ROUTE_ENTRY; ix --; )
362 if ((routing_tbl[ix].flags & IN_RTF_DEFINED) &&
363 (dst & routing_tbl[ix].mask) == routing_tbl[ix].target) {
364 if (routing_tbl[ix].gateway == 0)
365 return dst;
366 else {
367 return routing_tbl[ix].gateway;
368 }
369 }
370 return dst;
371 }
372
373#if NUM_REDIRECT_ROUTE_ENTRY > 0
374
375/*
376 * in4_rtredirect -- ルーティング表にエントリを登録する。
377 *
378 * 注意: 引数 tmo の単位は [ms]。
379 */
380
381void
382in4_rtredirect (T_IN4_ADDR gateway, T_IN4_ADDR target, uint8_t flags, uint32_t tmo)
383{
384 T_IN_RTENTRY *frt;
385
386 frt = in_rtnewentry(flags, tmo);
387 frt->gateway = gateway;
388 frt->target = target;
389 frt->mask = 0xffffffff;
390 }
391
392#endif /* of #if NUM_REDIRECT_ROUTE_ENTRY > 0 */
393
394/*
395 * in4_timer -- IPv4 å…
396±é€šã‚¿ã‚¤ãƒžãƒ¼
397 *
398 * 1秒周期で起動される。
399 */
400
401static void
402in4_timer (void *ignore)
403{
404#if NUM_REDIRECT_ROUTE_ENTRY > 0
405
406 in_rttimer();
407
408#endif /* of #if NUM_REDIRECT_ROUTE_ENTRY > 0 */
409
410#ifdef IP4_CFG_FRAGMENT
411
412 ip_frag_timer();
413
414#endif /* of #ifdef IP4_CFG_FRAGMENT */
415
416 timeout(in4_timer, NULL, IN_TIMER_TMO);
417 }
418
419/*
420 * in4_init -- IPv4 å…
421±é€šæ©Ÿèƒ½ã‚’初期化する。
422 */
423
424void
425in4_init (void)
426{
427#if NUM_REDIRECT_ROUTE_ENTRY > 0
428
429 in_rtinit();
430
431#endif /* of #if NUM_REDIRECT_ROUTE_ENTRY > 0 */
432
433 timeout(in4_timer, NULL, IN_TIMER_TMO);
434 }
435
436#endif /* of #if defined(SUPPORT_INET4) */
437
438#if NUM_REDIRECT_ROUTE_ENTRY > 0
439
440/*
441 * in_rtinit -- ルーティング表を初期化する。
442 */
443
444void
445in_rtinit (void)
446{
447 int_t ix;
448
449 for (ix = 0; ix < NUM_STATIC_ROUTE_ENTRY; ix ++)
450 routing_tbl[ix].flags = IN_RTF_DEFINED;
451
452 for ( ; ix < NUM_ROUTE_ENTRY; ix ++)
453 routing_tbl[ix].flags = 0;
454 }
455
456/*
457 * in_rtnewentry -- 新しいエントリを獲得する。
458 */
459
460T_IN_RTENTRY *
461in_rtnewentry (uint8_t flags, uint32_t tmo)
462{
463 SYSTIM now;
464 T_IN_RTENTRY *rt, *frt = NULL;
465 int_t ix;
466
467 /* 空きエントリを探す。*/
468 for (ix = NUM_STATIC_ROUTE_ENTRY; ix < NUM_ROUTE_ENTRY; ix ++) {
469 rt = &routing_tbl[ix];
470 if ((routing_tbl[ix].flags & IN_RTF_DEFINED) == 0) {
471 frt = rt;
472 break;
473 }
474 }
475
476 /* expire の単位は [s]。*/
477 syscall(get_tim(&now));
478 now /= SYSTIM_HZ;
479
480 if (frt == NULL) {
481 /* 空きがなければ、有効時間がもっとも短いエントリを空きにする。*/
482 T_IN_RTENTRY *srt = NULL;
483 int_t diff, sdiff = INT_MAX;
484
485 syscall(wai_sem(SEM_IN_ROUTING_TBL));
486 for (ix = NUM_STATIC_ROUTE_ENTRY; ix < NUM_ROUTE_ENTRY; ix ++) {
487 rt = &routing_tbl[ix];
488 diff = (int_t)(rt->expire - now);
489 if (diff <= 0) { /* rt->expire <= now */
490 /* 既に、有効時間が過ぎている。*/
491 frt = rt;
492 break;
493 }
494 else if (diff < sdiff) {
495 srt = rt;
496 sdiff = diff;
497 }
498 }
499 if (frt == NULL)
500 frt = srt;
501 frt->flags = 0;
502 syscall(sig_sem(SEM_IN_ROUTING_TBL));
503 }
504
505 frt->flags = (uint8_t)(flags | IN_RTF_DEFINED);
506 frt->expire = now + tmo / SYSTIM_HZ;
507 return frt;
508 }
509
510/*
511 * in_rttimer -- ルーティング表の管理タイマー
512 */
513
514void
515in_rttimer (void)
516{
517 SYSTIM now;
518 int_t ix;
519
520 /* expire の単位は [s]。*/
521 syscall(get_tim(&now));
522 now /= SYSTIM_HZ;
523
524 syscall(wai_sem(SEM_IN_ROUTING_TBL));
525 for (ix = NUM_STATIC_ROUTE_ENTRY; ix < NUM_ROUTE_ENTRY; ix ++)
526 if ((routing_tbl[ix].flags & IN_RTF_DEFINED) &&
527 (int_t)(routing_tbl[ix].expire - now) <= 0)
528 routing_tbl[ix].flags = 0;
529 syscall(sig_sem(SEM_IN_ROUTING_TBL));
530 }
531
532#endif /* of #if NUM_REDIRECT_ROUTE_ENTRY > 0 */
533
534/*
535 * in_cksum_sum -- チェックサムの合計計算関数
536 *
537 * 注意: data は 4 オクテット単位でパディングすること。
538 * data が 2 オクテット単位にアラインされていないと
539 * 例外が発生する可能性がある。
540 * len は 4 オクテット単位にアラインされていること。
541 *
542 * 戻り値はホストバイトオーダ
543 */
544
545uint32_t
546in_cksum_sum (void *data, uint_t len /*オクテット単位*/)
547{
548 uint32_t sum = 0;
549
550 for ( ; len > 0; len -= 2) {
551 sum += *((uint16_t*)data);
552 data = (uint8_t*)data + 2;
553 }
554
555#if _NET_CFG_BYTE_ORDER == _NET_CFG_BIG_ENDIAN
556 return sum;
557#elif _NET_CFG_BYTE_ORDER == _NET_CFG_LITTLE_ENDIAN
558 return ((sum >> 8) & 0xffff) + ((sum & 0xff) << 8) + ((sum >> 24) & 0xff);
559#endif /* #if _NET_CFG_BYTE_ORDER == _NET_CFG_BIG_ENDIAN */
560
561 }
562
563/*
564 * in_cksum_carry -- チェックサムの桁上げ計算関数
565 *
566 * 注意: data は 4 オクテット単位でパディングすること。
567 * data が 2 オクテット単位にアラインされていないと
568 * 例外が発生する可能性がある。
569 * len は 4 オクテット単位にアラインされていること。
570 */
571
572uint32_t
573in_cksum_carry (uint32_t sum)
574{
575 uint32_t carry;
576
577 while (sum >= 0x00010000) {
578 carry = sum >> 16;
579 sum = (sum & 0xffff) + carry;
580 }
581
582 return sum;
583 }
584
585/*
586 * in_strtfn -- API 機能コードの文字表現を返す。
587 */
588
589const char *
590in_strtfn (FN fncd)
591{
592 switch (fncd) {
593
594 /* TCP 関係 */
595
596 case TFN_TCP_CRE_REP:
597 return "TFN_TCP_CRE_REP";
598 break;
599 case TFN_TCP_DEL_REP:
600 return "TFN_TCP_DEL_REP";
601 break;
602 case TFN_TCP_CRE_CEP:
603 return "TFN_TCP_CRE_CEP";
604 break;
605 case TFN_TCP_DEL_CEP:
606 return "TFN_TCP_DEL_CEP";
607 break;
608 case TFN_TCP_ACP_CEP:
609 return "TFN_TCP_ACP_CEP";
610 break;
611 case TFN_TCP_CON_CEP:
612 return "TFN_TCP_CON_CEP";
613 break;
614 case TFN_TCP_SHT_CEP:
615 return "TFN_TCP_SHT_CEP";
616 break;
617 case TFN_TCP_CLS_CEP:
618 return "TFN_TCP_CLS_CEP";
619 break;
620 case TFN_TCP_SND_DAT:
621 return "TFN_TCP_SND_DAT";
622 break;
623 case TFN_TCP_RCV_DAT:
624 return "TFN_TCP_RCV_DAT";
625 break;
626 case TFN_TCP_GET_BUF:
627 return "TFN_TCP_GET_BUF";
628 break;
629 case TFN_TCP_SND_BUF:
630 return "TFN_TCP_SND_BUF";
631 break;
632 case TFN_TCP_RCV_BUF:
633 return "TFN_TCP_RCV_BUF";
634 break;
635 case TFN_TCP_REL_BUF:
636 return "TFN_TCP_REL_BUF";
637 break;
638 case TFN_TCP_SND_OOB:
639 return "TFN_TCP_SND_OOB";
640 break;
641 case TFN_TCP_RCV_OOB:
642 return "TFN_TCP_RCV_OOB";
643 break;
644 case TFN_TCP_CAN_CEP:
645 return "TFN_TCP_CAN_CEP";
646 break;
647 case TFN_TCP_SET_OPT:
648 return "TFN_TCP_SET_OPT";
649 break;
650 case TFN_TCP_GET_OPT:
651 return "TFN_TCP_GET_OPT";
652 break;
653 case TFN_TCP_ALL:
654 return "ALL";
655 break;
656
657 /* UDP 関係 */
658
659 case TFN_UDP_CRE_CEP:
660 return "TFN_UDP_CRE_CEP";
661 break;
662 case TFN_UDP_DEL_CEP:
663 return "TFN_UDP_DEL_CEP";
664 break;
665 case TFN_UDP_SND_DAT:
666 return "TFN_UDP_SND_DAT";
667 break;
668 case TFN_UDP_RCV_DAT:
669 return "TFN_UDP_RCV_DAT";
670 break;
671 case TFN_UDP_CAN_CEP:
672 return "TFN_UDP_CAN_CEP";
673 break;
674 case TFN_UDP_SET_OPT:
675 return "TFN_UDP_SET_OPT";
676 break;
677 case TFN_UDP_GET_OPT:
678 return "TFN_UDP_GET_OPT";
679 break;
680
681 default:
682 return "unknown TFN";
683 }
684 }
Note: See TracBrowser for help on using the repository browser.