Changeset 331 for EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/net_cons.c
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/net_cons.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 * … … 60 60 #endif /* of #ifdef TARGET_KERNEL_JSP */ 61 61 62 #include <tinet_defs.h>63 64 #include <net/if.h>65 #include <net/if_ppp.h>66 #include <net/if_loop.h>67 #include <net/ethernet.h>68 #include <net/net.h>69 #include <net/net_timer.h>70 71 62 #include <netinet/in.h> 72 63 #include <netinet/in_itron.h> … … 109 100 #define TELNET_OPT_IAC (255) 110 101 102 #if defined(SUPPORT_INET6) 103 #define API_PROTO '6' 104 #else 105 #define API_PROTO '4' 106 #endif 107 111 108 /* 112 109 * 変数 … … 121 118 bool_t wait_accept = false; /* 接続要求待ち中 */ 122 119 120 #if defined(SUPPORT_INET6) 121 122 T_IPV6EP dst; 123 124 #else /* of #if defined(SUPPORT_INET6) */ 125 123 126 #if defined(SUPPORT_INET4) 124 127 … … 126 129 127 130 #endif /* of #if defined(SUPPORT_INET4) */ 128 129 #if defined(SUPPORT_INET6)130 131 T_IPV6EP dst;132 131 133 132 #endif /* of #if defined(SUPPORT_INET6) */ … … 156 155 get_tim(&now); 157 156 if (*(ER*)p_parblk == E_OK) { 158 syslog(LOG_NOTICE, "[NCS :%02u CBN] connected: %6lu, from: %s.%u",159 cepid, now / SYSTIM_HZ, IP2STR(NULL, &dst.ipaddr), dst.portno);157 syslog(LOG_NOTICE, "[NCS%c:%02u CBN] conct: %7lu, from: %s.%u", 158 API_PROTO, cepid, now / SYSTIM_HZ, IP2STR(NULL, &dst.ipaddr), dst.portno); 160 159 connected = true; 161 160 } 162 161 else 163 syslog(LOG_NOTICE, "[NCS:%02d CBN] error: %s", itron_strerror(*(ER*)p_parblk)); 162 syslog(LOG_NOTICE, "[NCS%c:%02d CBN] error: %s", 163 API_PROTO, itron_strerror(*(ER*)p_parblk)); 164 164 snd_len = snd_off = rcv_len = rcv_off = 0; 165 165 wait_accept = false; … … 193 193 if (snd_off > 0) { 194 194 if ((error = tcp_snd_buf(NET_CONS_CEPID, snd_off)) != E_OK && error != E_CLS) 195 syslog(LOG_NOTICE, "[NCS :%02d SND] flush send error: %s",196 NET_CONS_CEPID, itron_strerror(error));195 syslog(LOG_NOTICE, "[NCS%c:%02d SND] flush send error: %s", 196 API_PROTO, NET_CONS_CEPID, itron_strerror(error)); 197 197 snd_len = snd_off = 0; 198 198 } … … 218 218 if ((error = tcp_snd_buf(NET_CONS_CEPID, snd_off)) != E_OK) { 219 219 if (error != E_CLS) 220 syslog(LOG_NOTICE, "[NCS :%02d SND] send buff error: %s",221 NET_CONS_CEPID, itron_strerror(error));220 syslog(LOG_NOTICE, "[NCS%c:%02d SND] send buff error: %s", 221 API_PROTO, NET_CONS_CEPID, itron_strerror(error)); 222 222 syscall(sig_sem(SEM_NET_CONS_SEND)); 223 223 return; … … 226 226 if ((snd_len = tcp_get_buf(NET_CONS_CEPID, (void*)&snd_buff, TMO_FEVR)) <= 0) { 227 227 if (snd_len != E_CLS) 228 syslog(LOG_NOTICE, "[NCS :%02d SND] get buff error: %s",229 NET_CONS_CEPID, itron_strerror(snd_len));228 syslog(LOG_NOTICE, "[NCS%c:%02d SND] get buff error: %s", 229 API_PROTO, NET_CONS_CEPID, itron_strerror(snd_len)); 230 230 syscall(sig_sem(SEM_NET_CONS_SEND)); 231 231 return; … … 253 253 if ((error = tcp_rel_buf(NET_CONS_CEPID, rcv_len)) != E_OK) { 254 254 if (error != E_CLS) 255 syslog(LOG_NOTICE, "[NCS :%02d RCV] release buff error: %s",256 NET_CONS_CEPID, itron_strerror(error));255 syslog(LOG_NOTICE, "[NCS%c:%02d RCV] release buff error: %s", 256 API_PROTO, NET_CONS_CEPID, itron_strerror(error)); 257 257 discon_net_cons(); 258 258 return EOF; … … 264 264 else if (rcv_len < 0) { 265 265 if (rcv_len != E_CLS) 266 syslog(LOG_NOTICE, "[NCS :%02d RCV] recieve buff error: %s",267 NET_CONS_CEPID, itron_strerror(rcv_len));266 syslog(LOG_NOTICE, "[NCS%c:%02d RCV] recieve buff error: %s", 267 API_PROTO, NET_CONS_CEPID, itron_strerror(rcv_len)); 268 268 discon_net_cons(); 269 269 return EOF; … … 284 284 { 285 285 T_SERIAL_RPOR rpor; 286 int_t ch , req;286 int_t ch; 287 287 char uch; 288 288 ER error; … … 292 292 error = TCP_ACP_CEP(NET_CONS_CEPID, NET_CONS_REPID, &dst, TMO_NBLK); 293 293 #if 0 294 syslog(LOG_NOTICE, "[NCS:%02d ACP] status: %s",NET_CONS_CEPID, itron_strerror(error)); 294 syslog(LOG_NOTICE, "[NCS%c:%02d ACP] status: %s", 295 API_PROTO, NET_CONS_CEPID, itron_strerror(error)); 295 296 #endif 296 297 if (error != E_WBLK) … … 307 308 case TELNET_OPT_DO: 308 309 case TELNET_OPT_DONT: 309 req =cons_getchar_raw();310 cons_getchar_raw(); 310 311 break; 311 312 case TELNET_OPT_SB: … … 354 355 if (snd_off > 0) { 355 356 if ((error = tcp_snd_buf(NET_CONS_CEPID, snd_off)) != E_OK && error != E_CLS) 356 syslog(LOG_NOTICE, "[NCS :%02d SND] send buff error: %s",357 NET_CONS_CEPID, itron_strerror(error));357 syslog(LOG_NOTICE, "[NCS%c:%02d SND] send buff error: %s", 358 API_PROTO, NET_CONS_CEPID, itron_strerror(error)); 358 359 } 359 360 if ((error = tcp_sht_cep(NET_CONS_CEPID)) != E_OK) 360 syslog(LOG_NOTICE, "[NCS :%02d SHT] shutdown error: %s",361 NET_CONS_CEPID, itron_strerror(error));361 syslog(LOG_NOTICE, "[NCS%c:%02d SHT] shutdown error: %s", 362 API_PROTO, NET_CONS_CEPID, itron_strerror(error)); 362 363 if ((error = tcp_cls_cep(NET_CONS_CEPID, TMO_FEVR)) != E_OK) 363 syslog(LOG_NOTICE, "[NCS :%02d CLS] close error: %s",364 NET_CONS_CEPID, itron_strerror(error));364 syslog(LOG_NOTICE, "[NCS%c:%02d CLS] close error: %s", 365 API_PROTO, NET_CONS_CEPID, itron_strerror(error)); 365 366 connected = false; 366 367 syscall(sig_sem(SEM_NET_CONS_SEND)); 367 368 get_tim(&now); 368 syslog(LOG_NOTICE, "[NCS :%02u SND] disconnected:%5lu, from: %s.%u",369 NET_CONS_CEPID, now / SYSTIM_HZ, IP2STR(NULL, &dst.ipaddr), dst.portno);369 syslog(LOG_NOTICE, "[NCS%c:%02u SND] discn: %7lu, from: %s.%u", 370 API_PROTO, NET_CONS_CEPID, now / SYSTIM_HZ, IP2STR(NULL, &dst.ipaddr), dst.portno); 370 371 } 371 372 return error; … … 499 500 case 'M': 500 501 str = va_arg(ap, char*); 501 put_macaddr(CONSOLE_PORTID, str, width);502 put_macaddr(CONSOLE_PORTID, (uint8_t *)str, width); 502 503 break; 503 504
Note:
See TracChangeset
for help on using the changeset viewer.