Changeset 331 for EcnlProtoTool/trunk/asp3_dcre/tinet/net/ppp.c
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tinet/net/ppp.c
r321 r331 2 2 * TINET (TCP/IP Protocol Stack) 3 3 * 4 * Copyright (C) 2001-20 09by Dep. of Computer Science and Engineering4 * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * … … 81 81 #include <net/if_ppp.h> 82 82 #include <net/net.h> 83 #include <net/net_endian.h> 84 #include <net/net_var.h> 83 85 #include <net/net_buf.h> 84 86 #include <net/net_timer.h> … … 89 91 #include <net/ppp_fsm.h> 90 92 #include <net/ppp_lcp.h> 93 #include <net/ppp_ipv6cp.h> 91 94 #include <net/ppp_ipcp.h> 92 95 #include <net/ppp_ccp.h> … … 108 111 T_PPP_PROTENT *protocols[] = { 109 112 &lcp_protent, 113 114 #ifdef _IP6_CFG 115 &ipv6cp_protent, 116 #endif /* of #ifdef _IP6_CFG */ 117 118 #ifdef _IP4_CFG 110 119 &ipcp_protent, 120 #endif /* of #ifdef _IP4_CFG */ 111 121 112 122 #ifdef SUPPORT_CCP 113 123 &ccp_protent, 114 #endif /* #ifdef SUPPORT_CCP */124 #endif /* of #ifdef SUPPORT_CCP */ 115 125 116 126 #ifdef LCP_CFG_PAP 117 127 &pap_protent, 118 #endif /* #ifdef LCP_CFG_PAP */128 #endif /* of #ifdef LCP_CFG_PAP */ 119 129 120 130 #ifdef LCP_CFG_CHAP 121 131 &chap_protent, 122 #endif /* #ifdef LCP_CFG_CHAP */132 #endif /* of #ifdef LCP_CFG_CHAP */ 123 133 124 134 NULL … … 223 233 #endif /* of #ifdef PPP_CFG_MODEM */ 224 234 235 #ifdef _IP6_CFG 236 /* IPV6CP の接続完了まで待つ。*/ 237 if ((error = wait_ipv6cp()) != E_OK) 238 goto buf_ret; 239 #endif /* of #ifdef _IP6_CFG */ 240 241 #ifdef _IP4_CFG 225 242 /* IPCP の接続完了まで待つ。*/ 226 243 if ((error = wait_ipcp()) != E_OK) 227 244 goto buf_ret; 245 #endif /* of #ifdef _IP4_CFG */ 246 247 #ifdef _IP4_CFG 248 /* IPCP の接続完了まで待つ。*/ 249 if ((error = wait_ipcp()) != E_OK) 250 goto buf_ret; 251 #endif /* of #ifdef _IP4_CFG */ 228 252 229 253 #ifdef PPP_IDLE_TIMEOUT … … 290 314 ID tskid; 291 315 int_t ix; 316 uint8_t rcount = 0; 292 317 293 318 /* ポートを初期設定する */ … … 321 346 /* PPP 出力タスクを起動する */ 322 347 syscall(act_tsk(PPP_OUTPUT_TASK)); 348 349 /* 乱数生成を初期化する。*/ 350 net_srand(0); 323 351 324 352 while (true) { … … 328 356 if (input->len > 0) { 329 357 330 #ifdef PPP_IDLE_TIMEOUT 358 /* 乱数生成を初期化する。*/ 359 if (rcount == 0) 360 net_srand(input->len); 361 rcount ++; 362 363 #ifdef PPP_IDLE_TIMEOUT 331 364 wai_sem(SEM_IDLE_TIMEOUT); 332 365 if (idle && ntohs(*GET_PPP_HDR(input)) != PPP_LCP) { … … 335 368 } 336 369 sig_sem(SEM_IDLE_TIMEOUT); 337 370 #endif /* of #ifdef PPP_IDLE_TIMEOUT */ 338 371 339 372 parse_input(input); … … 342 375 syscall(rel_net_buf(input)); 343 376 344 377 #ifdef PPP_IDLE_TIMEOUT 345 378 wai_sem(SEM_IDLE_TIMEOUT); 346 379 if (!idle && ppp_phase == PPP_PHASE_NETWORK) { … … 353 386 } 354 387 sig_sem(SEM_IDLE_TIMEOUT); 355 388 #endif /* of #ifdef PPP_IDLE_TIMEOUT */ 356 389 357 390 }
Note:
See TracChangeset
for help on using the changeset viewer.