Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24942/src/led Modified Files: address.c conn.c display.c frames.c join.c join.h kernel.c kernel.h main.c zeppelin.8 Added Files: .cvsignore Log Message: merge 2.5.0 branch into the head Index: address.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/address.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** address.c 9 Oct 2001 22:33:07 -0000 1.2 --- address.c 1 Jan 2008 00:14:50 -0000 1.3 *************** *** 53,57 **** fd = socket(PF_ATMSVC, SOCK_DGRAM, 0); if (fd < 0) { ! diag(COMPONENT, DIAG_ERROR, "addr_getesi: socket: %s\n", strerror(errno)); return -1; --- 53,57 ---- fd = socket(PF_ATMSVC, SOCK_DGRAM, 0); if (fd < 0) { ! diag(COMPONENT, DIAG_ERROR, "addr_getesi: socket: %s", strerror(errno)); return -1; *************** *** 61,65 **** req.length = ESI_LEN; retval = ioctl(fd, ATM_GETESI, &req); ! if (retval < 0) diag(COMPONENT, DIAG_ERROR, "ioctl ATM_GETESI: %s\n", strerror(errno)); close(fd); --- 61,65 ---- req.length = ESI_LEN; retval = ioctl(fd, ATM_GETESI, &req); ! if (retval < 0) diag(COMPONENT, DIAG_ERROR, "ioctl ATM_GETESI: %s", strerror(errno)); close(fd); *************** *** 80,84 **** fd = socket(PF_ATMSVC, SOCK_DGRAM, 0); if (fd < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_listenaddr: socket: %s\n", strerror(errno)); return -1; --- 80,84 ---- fd = socket(PF_ATMSVC, SOCK_DGRAM, 0); if (fd < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_listenaddr: socket: %s", strerror(errno)); return -1; *************** *** 88,92 **** req.length = sizeof(listen_addr); retval = ioctl(fd, ATM_GETADDR, &req); ! if (retval < 0) diag(COMPONENT, DIAG_ERROR, "ioctl ATM_GETADDR: %s\n", strerror(errno)); close(fd); --- 88,92 ---- req.length = sizeof(listen_addr); retval = ioctl(fd, ATM_GETADDR, &req); ! if (retval < 0) diag(COMPONENT, DIAG_ERROR, "ioctl ATM_GETADDR: %s", strerror(errno)); close(fd); Index: conn.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/conn.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** conn.c 9 Oct 2001 22:33:07 -0000 1.2 --- conn.c 1 Jan 2008 00:14:50 -0000 1.3 *************** *** 38,41 **** --- 38,42 ---- #include <errno.h> #include <sys/ioctl.h> + #include <time.h> #include <atm.h> *************** *** 117,121 **** char qos_text[MAX_ATM_QOS_LEN + 1]; ! diag(COMPONENT, DIAG_DEBUG, "init_conn_params, conn_type %x\n", conn_type); memset(qos, 0, sizeof(struct atm_qos)); --- 118,122 ---- char qos_text[MAX_ATM_QOS_LEN + 1]; ! diag(COMPONENT, DIAG_DEBUG, "init_conn_params, conn_type %x", conn_type); memset(qos, 0, sizeof(struct atm_qos)); *************** *** 136,140 **** break; default: ! diag(COMPONENT, DIAG_ERROR, "unknown conn_type %x\n", conn_type); break; } --- 137,141 ---- break; default: ! diag(COMPONENT, DIAG_ERROR, "unknown conn_type %x", conn_type); break; } *************** *** 147,151 **** if (qos2text(qos_text, sizeof(qos_text), qos, 0) < 0) sprintf(qos_text, "<bad qos>"); ! diag(COMPONENT, DIAG_DEBUG, "init_conn_params, QoS '%s'\n", qos_text); } --- 148,152 ---- if (qos2text(qos_text, sizeof(qos_text), qos, 0) < 0) sprintf(qos_text, "<bad qos>"); ! diag(COMPONENT, DIAG_DEBUG, "init_conn_params, QoS '%s'", qos_text); } *************** *** 193,209 **** s = socket(PF_ATMSVC, SOCK_DGRAM, 0); if (s < 0) { ! diag(COMPONENT, DIAG_ERROR, "socket creation failure: %s\n", strerror(errno)); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "get_socket: got fd %d\n", s); if (setsockopt(s, SOL_ATM, SO_ATMQOS, qos, sizeof(struct atm_qos)) < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_socket: setsockopt SO_ATMQOS: %s\n", strerror(errno)); close(s); return -1; } if (setsockopt(s, SOL_ATM, SO_ATMSAP, sap, sizeof(struct atm_sap)) < 0) { ! diag(COMPONENT, DIAG_ERROR, "setup_svc setsockop(SO_ATMSAP)\n"); close(s); return -1; --- 194,210 ---- s = socket(PF_ATMSVC, SOCK_DGRAM, 0); if (s < 0) { ! diag(COMPONENT, DIAG_ERROR, "socket creation failure: %s", strerror(errno)); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "get_socket: got fd %d", s); if (setsockopt(s, SOL_ATM, SO_ATMQOS, qos, sizeof(struct atm_qos)) < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_socket: setsockopt SO_ATMQOS: %s", strerror(errno)); close(s); return -1; } if (setsockopt(s, SOL_ATM, SO_ATMSAP, sap, sizeof(struct atm_sap)) < 0) { ! diag(COMPONENT, DIAG_ERROR, "setup_svc setsockop(SO_ATMSAP)"); close(s); return -1; *************** *** 215,219 **** ret = bind(s, (struct sockaddr *)listen_addr, sizeof(struct sockaddr_atmsvc)); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "bind error: %s\n", strerror(errno)); close(s); return -1; --- 216,220 ---- ret = bind(s, (struct sockaddr *)listen_addr, sizeof(struct sockaddr_atmsvc)); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "bind error: %s", strerror(errno)); close(s); return -1; *************** *** 224,236 **** - /* - * You need to check this if setup_svc() returns NULL - */ - #if 0 - if (is_data_direct(&sap->blli[0])) { - /* Try to remove possible entry in kernel */ - delete_addr(conn->atm_address); - } - #endif /* Does an active open to dst_addr using pre-filled * parameters in sap and qos. --- 225,228 ---- *************** *** 247,268 **** char buff[MAX_ATM_ADDR_LEN+1]; ! diag(COMPONENT, DIAG_DEBUG, "Outgoing call setup\n"); - /* The code below is commented out due to the following scenario: - We have made a connection to another LEC and our address was - numerically lower than theirs (LANEv2 8.1.13). - The other end has also connected us, but we must not use that - VCC. - However, if the connection we made gets closed, we can not open - it again since a connection to the destination LEC already exists. - */ - #if 0 - /* We don't create connection to an entity where we already have - a connection. */ - if (conn_already_exists(dst_addr->sas_addr.prv, NULL) && - is_data_direct(&sap->blli[0])) - return NULL; - #endif - dst_addr->sas_family = AF_ATMSVC; listen_addr->sas_family = AF_ATMSVC; --- 239,244 ---- char buff[MAX_ATM_ADDR_LEN+1]; ! diag(COMPONENT, DIAG_DEBUG, "Outgoing call setup"); dst_addr->sas_family = AF_ATMSVC; listen_addr->sas_family = AF_ATMSVC; *************** *** 270,289 **** switch(sap->blli[0].l3.tr9577.snap[4]) { /* Kludge. Eh? */ case CONTROL_CONN: ! diag(COMPONENT, DIAG_DEBUG, "LE Control SVC setup\n"); break; case DATA_DIRECT_8023: ! diag(COMPONENT, DIAG_DEBUG, "Data direct 802.3\n"); break; case DATA_DIRECT_8025: ! diag(COMPONENT, DIAG_DEBUG, "Data direct 802.5\n"); break; case MCAST_CONN_8023: ! diag(COMPONENT, DIAG_DEBUG, "Multicast 802.3\n"); break; case MCAST_CONN_8025: ! diag(COMPONENT, DIAG_DEBUG, "Multicast 802.5\n"); break; default: ! diag(COMPONENT, DIAG_ERROR, "Unknown codepoint in svc setup\n"); } --- 246,265 ---- switch(sap->blli[0].l3.tr9577.snap[4]) { /* Kludge. Eh? */ case CONTROL_CONN: ! diag(COMPONENT, DIAG_DEBUG, "LE Control SVC setup"); break; case DATA_DIRECT_8023: ! diag(COMPONENT, DIAG_DEBUG, "Data direct 802.3"); break; case DATA_DIRECT_8025: ! diag(COMPONENT, DIAG_DEBUG, "Data direct 802.5"); break; case MCAST_CONN_8023: ! diag(COMPONENT, DIAG_DEBUG, "Multicast 802.3"); break; case MCAST_CONN_8025: ! diag(COMPONENT, DIAG_DEBUG, "Multicast 802.5"); break; default: ! diag(COMPONENT, DIAG_ERROR, "Unknown codepoint in svc setup"); } *************** *** 298,305 **** ret = fcntl(s, F_GETFL); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "fcntl(s, F_GETFL)\n"); close(s); } else if (fcntl(s, F_SETFL, ret|O_NONBLOCK) < 0) { ! diag(COMPONENT, DIAG_ERROR, "fcntl(s, F_SETFL, x|O_NONBLOCK)\n"); close(s); return NULL; --- 274,281 ---- ret = fcntl(s, F_GETFL); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "fcntl(s, F_GETFL)"); close(s); } else if (fcntl(s, F_SETFL, ret|O_NONBLOCK) < 0) { ! diag(COMPONENT, DIAG_ERROR, "fcntl(s, F_SETFL, x|O_NONBLOCK)"); close(s); return NULL; *************** *** 309,313 **** ret = connect(s, (struct sockaddr *)dst_addr, sizeof(struct sockaddr_atmsvc)); if (ret < 0 && errno != EINPROGRESS) { ! diag(COMPONENT, DIAG_ERROR, "connect error: %s\n", strerror(errno)); close(s); return NULL; --- 285,289 ---- ret = connect(s, (struct sockaddr *)dst_addr, sizeof(struct sockaddr_atmsvc)); if (ret < 0 && errno != EINPROGRESS) { ! diag(COMPONENT, DIAG_ERROR, "connect error: %s", strerror(errno)); close(s); return NULL; *************** *** 315,319 **** conn = list_add_conn(dst_addr->sas_addr.prv); ! diag(COMPONENT, DIAG_DEBUG, "Conn:%p\n", conn); if (conn == NULL) { close(s); --- 291,295 ---- conn = list_add_conn(dst_addr->sas_addr.prv); ! diag(COMPONENT, DIAG_DEBUG, "Conn:%p", conn); if (conn == NULL) { close(s); *************** *** 349,353 **** lec_params.data_listen = create_listensocket(&addr, &sap, &qos); if (lec_params.data_listen == NULL) { ! diag(COMPONENT, DIAG_FATAL, "Could not create listen socket for incoming Data Direct VCCs\n"); return -1; } --- 325,329 ---- lec_params.data_listen = create_listensocket(&addr, &sap, &qos); if (lec_params.data_listen == NULL) { ! diag(COMPONENT, DIAG_FATAL, "Could not create listen socket for incoming Data Direct VCCs"); return -1; } *************** *** 376,380 **** conn = setup_svc(&dst_addr, &my_addr, &sap, &qos); if (conn == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Could not create Data Direct VCC\n"); delete_addr(dst_addr.sas_addr.prv); return -1; --- 352,356 ---- conn = setup_svc(&dst_addr, &my_addr, &sap, &qos); if (conn == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Could not create Data Direct VCC"); delete_addr(dst_addr.sas_addr.prv); return -1; *************** *** 394,405 **** Conn_t *conn; ! diag(COMPONENT, DIAG_DEBUG, "conn_create_listensocket\n"); fd = get_socket(listen_addr, sap, qos); if (fd < 0) return NULL; ! ret = listen(fd, 5); if (ret != 0) { ! diag(COMPONENT, DIAG_DEBUG, "Listen failed: %s\n", strerror(errno)); close(fd); return NULL; --- 370,381 ---- Conn_t *conn; ! diag(COMPONENT, DIAG_DEBUG, "conn_create_listensocket"); fd = get_socket(listen_addr, sap, qos); if (fd < 0) return NULL; ! ret = listen(fd, 16); if (ret != 0) { ! diag(COMPONENT, DIAG_DEBUG, "Listen failed: %s", strerror(errno)); close(fd); return NULL; *************** *** 408,412 **** conn = list_add_conn(NULL); if (conn == NULL) { ! diag(COMPONENT, DIAG_ERROR, "List_add_conn failed\n"); close(fd); return NULL; --- 384,388 ---- conn = list_add_conn(NULL); if (conn == NULL) { ! diag(COMPONENT, DIAG_ERROR, "List_add_conn failed"); close(fd); return NULL; *************** *** 415,419 **** conn->type = LISTENING; conn->fd = fd; ! diag(COMPONENT, DIAG_DEBUG, "Listen socket created blli:%2.2x %2.2x fd: %d\n", sap->blli[0].l3.tr9577.snap[3], sap->blli[0].l3.tr9577.snap[4], --- 391,395 ---- conn->type = LISTENING; conn->fd = fd; ! diag(COMPONENT, DIAG_DEBUG, "Listen socket created blli:%2.2x %2.2x fd: %d", sap->blli[0].l3.tr9577.snap[3], sap->blli[0].l3.tr9577.snap[4], *************** *** 434,443 **** char buff[MAX_ATM_ADDR_LEN+1]; ! diag(COMPONENT, DIAG_DEBUG, "Accepting connection on fd %d\n", conn->fd); len = sizeof(addr); fd = accept(conn->fd, (struct sockaddr *)&addr, &len); ! diag(COMPONENT, DIAG_DEBUG, "accept returned %d\n", fd); if (fd < 0) { ! diag(COMPONENT, DIAG_ERROR, "accept: %s\n", strerror(errno)); return NULL; } --- 410,419 ---- char buff[MAX_ATM_ADDR_LEN+1]; ! diag(COMPONENT, DIAG_DEBUG, "Accepting connection on fd %d", conn->fd); len = sizeof(addr); fd = accept(conn->fd, (struct sockaddr *)&addr, &len); ! diag(COMPONENT, DIAG_DEBUG, "accept returned %d", fd); if (fd < 0) { ! diag(COMPONENT, DIAG_ERROR, "accept: %s", strerror(errno)); return NULL; } *************** *** 458,462 **** } ! /* Close all connections, important or not. */ void close_connections(void) --- 434,438 ---- } ! /* Close all connections, except the kernel socket. */ void close_connections(void) *************** *** 465,474 **** for(conn = connlist; conn; conn = next) { ! diag(COMPONENT, DIAG_DEBUG, "Destroying:%p fd:%d type:%d\n", ! conn, conn->fd, conn->type); ! next = conn->next; ! close(conn->fd); ! list_remove_conn(conn); ! free(conn); } --- 441,452 ---- for(conn = connlist; conn; conn = next) { ! next = conn->next; ! if (conn->type != KERNEL_SOCK) { ! diag(COMPONENT, DIAG_DEBUG, "Destroying:%p fd:%d type:%d", ! conn, conn->fd, conn->type); ! close(conn->fd); ! list_remove_conn(conn); ! free(conn); ! } } *************** *** 487,491 **** Conn_t *mcast; ! diag(COMPONENT, DIAG_DEBUG, "close_connection %p\n", conn); if (conn == lec_params.kernel || --- 465,469 ---- Conn_t *mcast; ! diag(COMPONENT, DIAG_DEBUG, "close_connection %p", conn); if (conn == lec_params.kernel || *************** *** 518,522 **** static int handle_accept(Conn_t *conn) { ! Conn_t *new; struct atmlec_ioc ioc; --- 496,500 ---- static int handle_accept(Conn_t *conn) { ! Conn_t *new, *existing = NULL; struct atmlec_ioc ioc; *************** *** 525,547 **** if (conn == lec_params.mcast_listen) { ! diag(COMPONENT, DIAG_DEBUG, "Multicast Forward VCC accepted\n"); ioc.receive = 2; } else { ! diag(COMPONENT, DIAG_DEBUG, "Data Direct VCC accepted\n"); ioc.receive = 0; ! if (conn_already_exists(new->atm_address, new) && ! memcmp(lec_params.c1n_my_atm_addr, new->atm_address, ATM_ESA_LEN) < 0) { ! diag(COMPONENT, DIAG_DEBUG, "Using it only to receive, spec 8.1.1\n"); ! ioc.receive = 1; ! } } memcpy(ioc.atm_addr, new->atm_address, ATM_ESA_LEN); ioc.dev_num = lec_params.itf_num; ! diag(COMPONENT, DIAG_DEBUG, "Attaching a new VCC, fd %d\n", new->fd); if (ioctl(new->fd, ATMLEC_DATA, &ioc) < 0) { ! diag(COMPONENT, DIAG_ERROR, "VCC attach failed: ioctl: %s\n", strerror(errno)); return -1; } return 0; } --- 503,532 ---- if (conn == lec_params.mcast_listen) { ! diag(COMPONENT, DIAG_DEBUG, "Multicast Forward VCC accepted"); ioc.receive = 2; } else { ! diag(COMPONENT, DIAG_DEBUG, "Data Direct VCC accepted"); ioc.receive = 0; ! if ((existing = conn_already_exists(new->atm_address, new)) && ! /* is calling address > called address */ ! (memcmp(new->atm_address, lec_params.c1n_my_atm_addr, ATM_ESA_LEN) > 0)) { ! diag(COMPONENT, DIAG_DEBUG, "Using it only to receive, spec 8.1.13"); ! ioc.receive = 1; ! existing = NULL; ! } } memcpy(ioc.atm_addr, new->atm_address, ATM_ESA_LEN); ioc.dev_num = lec_params.itf_num; ! diag(COMPONENT, DIAG_DEBUG, "Attaching a new VCC, fd %d", new->fd); if (ioctl(new->fd, ATMLEC_DATA, &ioc) < 0) { ! diag(COMPONENT, DIAG_ERROR, "VCC attach failed: ioctl: %s", strerror(errno)); return -1; } + if (existing && existing->status == CONNECTED) { + diag(COMPONENT, DIAG_DEBUG, "Closing old data direct, fd %d", existing->fd); + close_connection(existing); + } + return 0; } *************** *** 559,567 **** retval = recv_frame(conn, buff, sizeof(buff)); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "handle_data: read: %s\n", strerror(errno)); return (close_connection(conn)); } if (retval == 0) { ! diag(COMPONENT, DIAG_DEBUG, "fd %d, Data or Multicast VCC closed\n", conn->fd); return (close_connection(conn)); } --- 544,552 ---- retval = recv_frame(conn, buff, sizeof(buff)); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "handle_data: read: %s", strerror(errno)); return (close_connection(conn)); } if (retval == 0) { ! diag(COMPONENT, DIAG_DEBUG, "fd %d, Data or Multicast VCC closed", conn->fd); return (close_connection(conn)); } *************** *** 598,602 **** break; default: ! diag(COMPONENT, DIAG_ERROR, "check_connections: bad_type '%s'\n", get_type_string(conn->type)); break; --- 583,587 ---- break; default: ! diag(COMPONENT, DIAG_ERROR, "check_connections: bad_type '%s'", get_type_string(conn->type)); break; *************** *** 619,623 **** struct atmlec_ioc ioc; ! diag(COMPONENT, DIAG_DEBUG, "handle_connect: completing fd %d\n", conn->fd); /* this seems to be common method in Linux-ATM * making sure that nonblocking connect was --- 604,608 ---- struct atmlec_ioc ioc; ! diag(COMPONENT, DIAG_DEBUG, "handle_connect: completing fd %d", conn->fd); /* this seems to be common method in Linux-ATM * making sure that nonblocking connect was *************** *** 627,631 **** retval = connect(conn->fd, (struct sockaddr *)&dummy, sizeof(struct sockaddr_atmsvc)); if (retval < 0) { ! diag(COMPONENT, DIAG_DEBUG, "handle_connect: connect: %s\n", strerror(errno)); delete_addr(conn->atm_address); close_connection(conn); --- 612,616 ---- retval = connect(conn->fd, (struct sockaddr *)&dummy, sizeof(struct sockaddr_atmsvc)); if (retval < 0) { ! diag(COMPONENT, DIAG_DEBUG, "handle_connect: connect: %s", strerror(errno)); delete_addr(conn->atm_address); close_connection(conn); *************** *** 633,647 **** } - send_ready_ind(conn); - memcpy(ioc.atm_addr, conn->atm_address, ATM_ESA_LEN); ioc.dev_num = lec_params.itf_num; ioc.receive = 0; ! diag(COMPONENT, DIAG_DEBUG, "Attaching a new active VCC, fd %d\n", conn->fd); if (ioctl(conn->fd, ATMLEC_DATA, &ioc) < 0) { ! diag(COMPONENT, DIAG_ERROR, "VCC attach failed: ioctl: %s\n", strerror(errno)); return -1; } memset(&msg, 0, sizeof(struct atmlec_msg)); msg.type = l_flush_tran_id; --- 618,639 ---- } memcpy(ioc.atm_addr, conn->atm_address, ATM_ESA_LEN); ioc.dev_num = lec_params.itf_num; ioc.receive = 0; ! diag(COMPONENT, DIAG_DEBUG, "Attaching a new active VCC, fd %d", conn->fd); ! if (conn_already_exists(conn->atm_address, conn) && ! /* is calling address > called address */ ! memcmp(lec_params.c1n_my_atm_addr, conn->atm_address, ATM_ESA_LEN) > 0) { ! diag(COMPONENT, DIAG_DEBUG, "Receive only, spec 8.1.13 -- Closing"); ! close_connection(conn); ! return 0; ! } if (ioctl(conn->fd, ATMLEC_DATA, &ioc) < 0) { ! diag(COMPONENT, DIAG_ERROR, "VCC attach failed: ioctl: %s", strerror(errno)); return -1; } + send_ready_ind(conn); + memset(&msg, 0, sizeof(struct atmlec_msg)); msg.type = l_flush_tran_id; *************** *** 684,692 **** int ret; ! diag(COMPONENT, DIAG_DEBUG, "send_frame: fd:%d len:%ld\n", conn->fd, length); hdr = (struct frame_hdr *)frame; if (hdr->opcode == htons(READY_QUERY) || hdr->opcode == htons(READY_IND)) ! diag(COMPONENT, DIAG_DEBUG, "%s\n", opcode2text(hdr->opcode)); else display_frame(frame); --- 676,684 ---- int ret; ! diag(COMPONENT, DIAG_DEBUG, "send_frame: fd:%d len:%ld", conn->fd, length); hdr = (struct frame_hdr *)frame; if (hdr->opcode == htons(READY_QUERY) || hdr->opcode == htons(READY_IND)) ! diag(COMPONENT, DIAG_DEBUG, "%s", opcode2text(hdr->opcode)); else display_frame(frame); *************** *** 694,698 **** ret = write(conn->fd, frame, length); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "send_frame: write: %s\n", strerror(errno)); return -1; } --- 686,690 ---- ret = write(conn->fd, frame, length); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "send_frame: write: %s", strerror(errno)); return -1; } *************** *** 708,720 **** int ret; ! diag(COMPONENT, DIAG_DEBUG, "recv_frame: fd:%d\n", conn->fd); ret = read(conn->fd, buff, length); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "Read failed: %s\n", strerror(errno)); return -1; } #if 0 ! diag(COMPONENT, DIAG_DEBUG, "recv_frame: read %d bytes\n", ret); if (get_verbosity(COMPONENT) >= DIAG_DEBUG) { int i; --- 700,712 ---- int ret; ! diag(COMPONENT, DIAG_DEBUG, "recv_frame: fd:%d", conn->fd); ret = read(conn->fd, buff, length); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "Read failed: %s", strerror(errno)); return -1; } #if 0 ! diag(COMPONENT, DIAG_DEBUG, "recv_frame: read %d bytes", ret); if (get_verbosity(COMPONENT) >= DIAG_DEBUG) { int i; *************** *** 742,746 **** tv.tv_usec = (millis % 1000) * 1000; ! diag(COMPONENT, DIAG_DEBUG, "random_delay: sleeping %d.%d seconds\n", tv.tv_sec, tv.tv_usec); (void)select(0, NULL, NULL, NULL, &tv); --- 734,738 ---- tv.tv_usec = (millis % 1000) * 1000; ! diag(COMPONENT, DIAG_DEBUG, "random_delay: sleeping %d.%d seconds", tv.tv_sec, tv.tv_usec); (void)select(0, NULL, NULL, NULL, &tv); *************** *** 794,798 **** conn = list_add_conn(NULL); if (conn == NULL) { ! diag(COMPONENT, DIAG_ERROR, "conn_set_kernel_socket: list_add_conn failed\n"); return -1; } --- 786,790 ---- conn = list_add_conn(NULL); if (conn == NULL) { ! diag(COMPONENT, DIAG_ERROR, "conn_set_kernel_socket: list_add_conn failed"); return -1; } *************** *** 826,830 **** connlist->previous = conn; connlist = conn; ! diag(COMPONENT, DIAG_DEBUG, "Added conn:%p\n", conn); return conn; --- 818,822 ---- connlist->previous = conn; connlist = conn; ! diag(COMPONENT, DIAG_DEBUG, "Added conn:%p", conn); return conn; *************** *** 855,859 **** if (conn->next) conn->next->previous = conn->previous; ! diag(COMPONENT, DIAG_DEBUG, "Connlist: %p\n", connlist); conn->next=conn->previous= NULL; --- 847,851 ---- if (conn->next) conn->next->previous = conn->previous; ! diag(COMPONENT, DIAG_DEBUG, "Connlist: %p", connlist); conn->next=conn->previous= NULL; Index: display.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/display.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** display.c 9 Oct 2001 22:33:07 -0000 1.2 --- display.c 1 Jan 2008 00:14:51 -0000 1.3 *************** *** 68,72 **** *p = '\0'; ! diag(COMPONENT, DIAG_DEBUG, "%s\n", text); return; --- 68,72 ---- *p = '\0'; ! diag(COMPONENT, DIAG_DEBUG, "%s", text); return; *************** *** 75,79 **** static void display_ready(void *ready_frame) { ! diag(COMPONENT, DIAG_DEBUG, "ready frame\n"); return; --- 75,79 ---- static void display_ready(void *ready_frame) { ! diag(COMPONENT, DIAG_DEBUG, "ready frame"); return; Index: frames.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/frames.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** frames.c 9 Oct 2001 22:33:07 -0000 1.2 --- frames.c 1 Jan 2008 00:14:51 -0000 1.3 *************** *** 63,67 **** if (size < sizeof(struct ready_frame)) { ! diag(COMPONENT, DIAG_DEBUG, "short frame, size %d\n", size); return -1; } --- 63,67 ---- if (size < sizeof(struct ready_frame)) { ! diag(COMPONENT, DIAG_DEBUG, "short frame, size %d", size); return -1; } *************** *** 76,85 **** if (hdr->opcode == htons(READY_QUERY) || hdr->opcode == htons(READY_IND)) { ! diag(COMPONENT, DIAG_DEBUG, "Received a %s\n", opcode2text(hdr->opcode)); return 0; } if (size < sizeof(struct ctrl_frame)) { ! diag(COMPONENT, DIAG_DEBUG, "short frame, size %d\n", size); return -1; } --- 76,85 ---- if (hdr->opcode == htons(READY_QUERY) || hdr->opcode == htons(READY_IND)) { ! diag(COMPONENT, DIAG_DEBUG, "Received a %s", opcode2text(hdr->opcode)); return 0; } if (size < sizeof(struct ctrl_frame)) { ! diag(COMPONENT, DIAG_DEBUG, "short frame, size %d", size); return -1; } *************** *** 98,102 **** f->header.opcode = htons(LE_FLUSH_RSP); if (send_frame(lec_params.ctrl_direct, f, sizeof(struct ctrl_frame)) < 0) ! diag(COMPONENT, DIAG_DEBUG, "could not send LE_FLUSH_RESPONSE\n"); return; --- 98,102 ---- f->header.opcode = htons(LE_FLUSH_RSP); if (send_frame(lec_params.ctrl_direct, f, sizeof(struct ctrl_frame)) < 0) ! diag(COMPONENT, DIAG_DEBUG, "could not send LE_FLUSH_RESPONSE"); return; *************** *** 110,114 **** if (f->header.lec_id != htons(lec_params.c14_lec_id)) { ! diag(COMPONENT, DIAG_DEBUG, "Wrong lec_id, ignoring\n"); return; } --- 110,114 ---- if (f->header.lec_id != htons(lec_params.c14_lec_id)) { ! diag(COMPONENT, DIAG_DEBUG, "Wrong lec_id, ignoring"); return; } *************** *** 165,169 **** if (frame->header.lec_id == htons(lec_params.c14_lec_id)) { ! diag(COMPONENT, DIAG_DEBUG, "Ignoring own LE_ARP_REQUEST\n"); return 0; } --- 165,169 ---- if (frame->header.lec_id == htons(lec_params.c14_lec_id)) { ! diag(COMPONENT, DIAG_DEBUG, "Ignoring own LE_ARP_REQUEST"); return 0; } *************** *** 194,198 **** memcpy(msg->content.normal.mac_addr, frame->src_lan_dst.mac, ETH_ALEN); memcpy(msg->content.normal.atm_addr, frame->src_atm_addr, ATM_ESA_LEN); ! msg->content.normal.flag = (frame->header.flags & REMOTE_ADDRESS) ? 1 : 0; msg->content.normal.targetless_le_arp = 1; msg->sizeoftlvs = sizeoftlvs; --- 194,198 ---- memcpy(msg->content.normal.mac_addr, frame->src_lan_dst.mac, ETH_ALEN); memcpy(msg->content.normal.atm_addr, frame->src_atm_addr, ATM_ESA_LEN); ! msg->content.normal.flag = (frame->header.flags & htons(REMOTE_ADDRESS)) ? 1 : 0; msg->content.normal.targetless_le_arp = 1; msg->sizeoftlvs = sizeoftlvs; *************** *** 222,226 **** if (frame->header.lec_id == htons(lec_params.c14_lec_id) || lec_params.c29_v2_capable == 0) { ! diag(COMPONENT, DIAG_DEBUG, "Ignoring LE_NARP_REQUEST\n"); return 0; } --- 222,226 ---- if (frame->header.lec_id == htons(lec_params.c14_lec_id) || lec_params.c29_v2_capable == 0) { ! diag(COMPONENT, DIAG_DEBUG, "Ignoring LE_NARP_REQUEST"); return 0; } *************** *** 237,241 **** memcpy(msg->content.normal.mac_addr, frame->src_lan_dst.mac, ETH_ALEN); memcpy(msg->content.normal.atm_addr, frame->src_atm_addr, ATM_ESA_LEN); ! msg->content.normal.flag = (frame->header.flags & REMOTE_ADDRESS) ? 1 : 0; msg->content.normal.no_source_le_narp = no_source; msg->sizeoftlvs = sizeoftlvs; --- 237,241 ---- memcpy(msg->content.normal.mac_addr, frame->src_lan_dst.mac, ETH_ALEN); memcpy(msg->content.normal.atm_addr, frame->src_atm_addr, ATM_ESA_LEN); ! msg->content.normal.flag = (frame->header.flags & htons(REMOTE_ADDRESS)) ? 1 : 0; msg->content.normal.no_source_le_narp = no_source; msg->sizeoftlvs = sizeoftlvs; *************** *** 258,262 **** if (frame->header.lec_id != htons(lec_params.c14_lec_id)) { ! diag(COMPONENT, DIAG_DEBUG, "Wrong lec_id, ignoring\n"); return 0; } --- 258,262 ---- if (frame->header.lec_id != htons(lec_params.c14_lec_id)) { ! diag(COMPONENT, DIAG_DEBUG, "Wrong lec_id, ignoring"); return 0; } *************** *** 270,274 **** memcpy(msg->content.normal.mac_addr, frame->target_lan_dst.mac, ETH_ALEN); memcpy(msg->content.normal.atm_addr, frame->target_atm_addr, ATM_ESA_LEN); ! msg->content.normal.flag = (frame->header.flags & REMOTE_ADDRESS) ? 1 : 0; msg->sizeoftlvs = sizeoftlvs; if (sizeoftlvs > 0) memcpy(msg + 1, frame + 1, sizeoftlvs); --- 270,274 ---- memcpy(msg->content.normal.mac_addr, frame->target_lan_dst.mac, ETH_ALEN); memcpy(msg->content.normal.atm_addr, frame->target_atm_addr, ATM_ESA_LEN); ! msg->content.normal.flag = (frame->header.flags & htons(REMOTE_ADDRESS)) ? 1 : 0; msg->sizeoftlvs = sizeoftlvs; if (sizeoftlvs > 0) memcpy(msg + 1, frame + 1, sizeoftlvs); *************** *** 294,297 **** --- 294,312 ---- } + static void handle_ready_ind(Conn_t *conn) + { + struct atmlec_msg msg; + + /* FIXME -- if its a receive only vcc we should not do this */ + + diag(COMPONENT, DIAG_DEBUG, "READY_IND, on fd %d; sending LE_FLUSH_REQ", conn->fd); + memset(&msg, 0, sizeof(struct atmlec_msg)); + msg.type = l_flush_tran_id; + memcpy(msg.content.normal.atm_addr, conn->atm_address, ATM_ESA_LEN); + msg.content.normal.flag = send_flush_req(conn); + + msg_to_kernel(&msg, sizeof(struct atmlec_msg)); + } + /* Processes and validates incoming frames. Calls frame * dependant handler functions. *************** *** 312,315 **** --- 327,331 ---- break; case LE_FLUSH_RSP: + diag(COMPONENT, DIAG_DEBUG, "LE_FLUSH_RESPONSE, on fd %d", conn->fd); handle_flush_rsp(frame); break; *************** *** 318,322 **** break; case READY_IND: ! /* We can ignore these */ break; case LE_ARP_REQ: --- 334,338 ---- break; case READY_IND: ! handle_ready_ind(conn); break; case LE_ARP_REQ: *************** *** 341,345 **** default: diag(COMPONENT, DIAG_ERROR, ! "Unknown frame, opcode 0x%x %s\n", ntohs(frame->header.opcode), opcode2text(frame->header.opcode)); break; --- 357,361 ---- default: diag(COMPONENT, DIAG_ERROR, ! "Unknown frame, opcode 0x%x %s", ntohs(frame->header.opcode), opcode2text(frame->header.opcode)); break; *************** *** 363,367 **** retval = send_frame(conn, &frame, sizeof(struct ready_frame)); if (retval < 0) ! diag(COMPONENT, DIAG_DEBUG, "Could not send READY_IND, fd %d\n", conn->fd); return; --- 379,383 ---- retval = send_frame(conn, &frame, sizeof(struct ready_frame)); if (retval < 0) ! diag(COMPONENT, DIAG_DEBUG, "Could not send READY_IND, fd %d", conn->fd); return; *************** *** 421,425 **** len = tlvp[4]; tlvp += 5; ! diag(COMPONENT, DIAG_DEBUG, "parse_tlvs: type %s len %d\n", tlv2text(type), len); if (tlvp + len > end_of_tlvs) --- 437,441 ---- len = tlvp[4]; tlvp += 5; ! diag(COMPONENT, DIAG_DEBUG, "parse_tlvs: type %s len %d", tlv2text(type), len); if (tlvp + len > end_of_tlvs) *************** *** 460,464 **** value16 = *(uint16_t *)tlvp; value16 = ntohs(value16); ! diag(COMPONENT, DIAG_DEBUG, "value of TLV %d\n", value16); switch (type) { case MAX_CUM_CTRL_TIMEOUT: --- 476,480 ---- value16 = *(uint16_t *)tlvp; value16 = ntohs(value16); ! diag(COMPONENT, DIAG_DEBUG, "value of TLV %d", value16); switch (type) { case MAX_CUM_CTRL_TIMEOUT: *************** *** 500,504 **** value32 = *(uint32_t *)tlvp; value32 = ntohl(value32); ! diag(COMPONENT, DIAG_DEBUG, "value of TLV %d\n", value32); switch (type) { case VCC_TIMEOUT_PERIOD: --- 516,520 ---- value32 = *(uint32_t *)tlvp; value32 = ntohl(value32); ! diag(COMPONENT, DIAG_DEBUG, "value of TLV %d", value32); switch (type) { case VCC_TIMEOUT_PERIOD: *************** *** 538,542 **** switch(type) { case CONFIG_FRAG_INFO: ! diag(COMPONENT, DIAG_INFO, "Got Config-Frag-Info TLV\n"); break; case LAYER3_ADDRESS: --- 554,558 ---- switch(type) { case CONFIG_FRAG_INFO: ! diag(COMPONENT, DIAG_INFO, "Got Config-Frag-Info TLV"); break; case LAYER3_ADDRESS: *************** *** 553,557 **** whine: ! diag(COMPONENT, DIAG_DEBUG, "Unknown TLV, type 0x%x, len %d\n", type, len); return; --- 569,573 ---- whine: ! diag(COMPONENT, DIAG_DEBUG, "Unknown TLV, type 0x%x, len %d", type, len); return; *************** *** 565,569 **** return; if (opcode != ntohs(LE_CONFIG_RSP)) { ! diag(COMPONENT, DIAG_WARN, "X5-Adjustment TLV received but not with LE_CONFIG_RSP\n"); return; } --- 581,585 ---- return; if (opcode != ntohs(LE_CONFIG_RSP)) { ! diag(COMPONENT, DIAG_WARN, "X5-Adjustment TLV received but not with LE_CONFIG_RSP"); return; } Index: join.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/join.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** join.c 9 Oct 2001 22:33:07 -0000 1.2 --- join.c 1 Jan 2008 00:14:51 -0000 1.3 *************** *** 116,120 **** Conn_t *conn; ! diag(COMPONENT, DIAG_DEBUG, "entering lec_configure\n"); /* initialize well known LECS addresses */ --- 116,120 ---- Conn_t *conn; ! diag(COMPONENT, DIAG_DEBUG, "entering lec_configure"); /* initialize well known LECS addresses */ *************** *** 132,137 **** init_conn_params(&sap, &qos, CONTROL_CONN); ! if (lecs_method == LECS_MANUAL) { ! diag(COMPONENT, DIAG_DEBUG, "trying manual LECS address\n"); conn = setup_svc(manual_atm_addr, listen_addr, &sap, &qos); if (conn) { --- 132,137 ---- init_conn_params(&sap, &qos, CONTROL_CONN); ! if ((lecs_method == LECS_MANUAL) || (lecs_method == LECS_FROM_ILMI)) { ! diag(COMPONENT, DIAG_DEBUG, "trying manual LECS address"); conn = setup_svc(manual_atm_addr, listen_addr, &sap, &qos); if (conn) { *************** *** 142,146 **** else random_delay(); } ! diag(COMPONENT, DIAG_DEBUG, "trying well-known anycast LECS address\n"); conn = setup_svc(&addr_c5, listen_addr, &sap, &qos); if (conn) { --- 142,146 ---- else random_delay(); } ! diag(COMPONENT, DIAG_DEBUG, "trying well-known anycast LECS address"); conn = setup_svc(&addr_c5, listen_addr, &sap, &qos); if (conn) { *************** *** 150,154 **** } else random_delay(); ! diag(COMPONENT, DIAG_DEBUG, "trying well-known LECS address\n"); conn = setup_svc(&addr_47, listen_addr, &sap, &qos); if (conn) { --- 150,154 ---- } else random_delay(); ! diag(COMPONENT, DIAG_DEBUG, "trying well-known LECS address"); conn = setup_svc(&addr_47, listen_addr, &sap, &qos); if (conn) { *************** *** 182,191 **** lec_params.c7c_current_timeout = lec_params.c7i_initial_ctrl_timeout; /* reset it */ if (frame_size == 0) { ! diag(COMPONENT, DIAG_INFO, "Timed out while waiting for LE_CONFIGURE_RESPONSE\n"); return -1; /* timeout */ } if (parse_config_rsp(buff, frame_size) < 0) { ! diag(COMPONENT, DIAG_ERROR, "Parsing LE_CONFIG_RESPONSE indicates failure\n"); return -1; } --- 182,191 ---- lec_params.c7c_current_timeout = lec_params.c7i_initial_ctrl_timeout; /* reset it */ if (frame_size == 0) { ! diag(COMPONENT, DIAG_INFO, "Timed out while waiting for LE_CONFIGURE_RESPONSE"); return -1; /* timeout */ } if (parse_config_rsp(buff, frame_size) < 0) { ! diag(COMPONENT, DIAG_ERROR, "Parsing LE_CONFIG_RESPONSE indicates failure"); return -1; } *************** *** 204,208 **** char buff[MAX_CTRL_FRAME]; ! diag(COMPONENT, DIAG_DEBUG, "Sending LE_CONFIGURE_REQUEST\n"); /* TLVs make config frame variable length */ --- 204,208 ---- char buff[MAX_CTRL_FRAME]; ! diag(COMPONENT, DIAG_DEBUG, "Sending LE_CONFIGURE_REQUEST"); /* TLVs make config frame variable length */ *************** *** 252,256 **** retval = select(conn->fd + 1, &rfds, NULL, NULL, &tv); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "read_ctrl_rsp: select: %s\n", strerror(errno)); return retval; --- 252,256 ---- retval = select(conn->fd + 1, &rfds, NULL, NULL, &tv); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "read_ctrl_rsp: select: %s", strerror(errno)); return retval; *************** *** 260,269 **** frame_size = recv_frame(conn, buff, buffsize); if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERROR, "read_ctrl_rsp: recv_frame: %s\n", strerror(errno)); return frame_size; } if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "read_ctrl_rsp: conn closed: %s\n", strerror(errno)); return -1; --- 260,269 ---- frame_size = recv_frame(conn, buff, buffsize); if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERROR, "read_ctrl_rsp: recv_frame: %s", strerror(errno)); return frame_size; } if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "read_ctrl_rsp: conn closed: %s", strerror(errno)); return -1; *************** *** 281,287 **** struct ctrl_frame *frame; ! diag(COMPONENT, DIAG_DEBUG, "Parsing LE_CONFIG_RESPONSE\n"); if (validate_frame(buff, size) < 0) { ! diag(COMPONENT, DIAG_ERROR, "parse_config_rsp: bad frame\n"); return -1; } --- 281,287 ---- struct ctrl_frame *frame; ! diag(COMPONENT, DIAG_DEBUG, "Parsing LE_CONFIG_RESPONSE"); if (validate_frame(buff, size) < 0) { ! diag(COMPONENT, DIAG_ERROR, "parse_config_rsp: bad frame"); return -1; } *************** *** 289,298 **** frame = (struct ctrl_frame *)buff; if (frame->header.opcode != htons(LE_CONFIG_RSP)) { ! diag(COMPONENT, DIAG_ERROR, "parse_config_rsp: not a LE_CONFIG_RESPONSE\n"); return -1; } if (frame->header.status != 0) { ! diag(COMPONENT, DIAG_ERROR, "LECS said: %s\n", status2text(frame->header.status)); return -1; --- 289,298 ---- frame = (struct ctrl_frame *)buff; if (frame->header.opcode != htons(LE_CONFIG_RSP)) { ! diag(COMPONENT, DIAG_ERROR, "parse_config_rsp: not a LE_CONFIG_RESPONSE"); return -1; } if (frame->header.status != 0) { ! diag(COMPONENT, DIAG_ERROR, "LECS said: %s", status2text(frame->header.status)); return -1; *************** *** 333,340 **** int frame_size = 0; /* shut up, GCC */ ! diag(COMPONENT, DIAG_DEBUG, "Entering Join phase\n"); if (lecs_method == LECS_NONE) { ! diag(COMPONENT, DIAG_DEBUG, "Skipping LECS, connecting straight to LES\n"); memcpy(les_addr.sas_addr.prv, manual_atm_addr->sas_addr.prv, ATM_ESA_LEN); } else memcpy(les_addr.sas_addr.prv, lec_params.c9_les_atm_addr, ATM_ESA_LEN); --- 333,340 ---- int frame_size = 0; /* shut up, GCC */ ! diag(COMPONENT, DIAG_DEBUG, "Entering Join phase"); if (lecs_method == LECS_NONE) { ! diag(COMPONENT, DIAG_DEBUG, "Skipping LECS, connecting straight to LES"); memcpy(les_addr.sas_addr.prv, manual_atm_addr->sas_addr.prv, ATM_ESA_LEN); } else memcpy(les_addr.sas_addr.prv, lec_params.c9_les_atm_addr, ATM_ESA_LEN); *************** *** 344,348 **** lec_params.ctrl_direct = setup_svc(&les_addr, listen_addr, &sap, &qos); if (lec_params.ctrl_direct == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Control direct SVC failed\n"); random_delay(); return -1; --- 344,348 ---- lec_params.ctrl_direct = setup_svc(&les_addr, listen_addr, &sap, &qos); if (lec_params.ctrl_direct == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Control direct SVC failed"); random_delay(); return -1; *************** *** 350,354 **** lec_params.ctrl_listen = create_listensocket(listen_addr, &sap, &qos); if (lec_params.ctrl_listen == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Control distribute listen socket failed\n"); random_delay(); return -1; --- 350,354 ---- lec_params.ctrl_listen = create_listensocket(listen_addr, &sap, &qos); if (lec_params.ctrl_listen == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Control distribute listen socket failed"); random_delay(); return -1; *************** *** 358,362 **** while (lec_params.c7c_current_timeout <= lec_params.c7_ctrl_timeout) { if (send_join_req(lec_params.ctrl_direct) < 0) { ! diag(COMPONENT, DIAG_ERROR, "Sending LE_JOIN_REQUEST failed\n"); random_delay(); return -1; --- 358,362 ---- while (lec_params.c7c_current_timeout <= lec_params.c7_ctrl_timeout) { if (send_join_req(lec_params.ctrl_direct) < 0) { ! diag(COMPONENT, DIAG_ERROR, "Sending LE_JOIN_REQUEST failed"); random_delay(); return -1; *************** *** 364,368 **** frame_size = read_join_rsp(buff, sizeof(buff)); if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERROR, "Receiving LE_JOIN_RESPONSE failed\n"); random_delay(); return -1; --- 364,368 ---- frame_size = read_join_rsp(buff, sizeof(buff)); if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERROR, "Receiving LE_JOIN_RESPONSE failed"); random_delay(); return -1; *************** *** 374,383 **** lec_params.c7c_current_timeout = lec_params.c7i_initial_ctrl_timeout; /* reset it */ if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "LE_JOIN_RESPONSE timed out\n"); return -1; } if (parse_join_rsp(buff, frame_size) < 0) { ! diag(COMPONENT, DIAG_ERROR, "Parsing LE_JOIN_RESPONSE failed\n"); return -1; } --- 374,383 ---- lec_params.c7c_current_timeout = lec_params.c7i_initial_ctrl_timeout; /* reset it */ if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "LE_JOIN_RESPONSE timed out"); return -1; } if (parse_join_rsp(buff, frame_size) < 0) { ! diag(COMPONENT, DIAG_ERROR, "Parsing LE_JOIN_RESPONSE failed"); return -1; } *************** *** 473,477 **** retval = select(n, &rfds, NULL, NULL, &tv); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_join_rsp: select: %s\n", strerror(errno)); return -1; --- 473,477 ---- retval = select(n, &rfds, NULL, NULL, &tv); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_join_rsp: select: %s", strerror(errno)); return -1; *************** *** 486,498 **** frame_size = recv_frame(lec_params.ctrl_direct, buff, buffsize); if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_join_rsp: recv_frame: %s\n", strerror(errno)); return -1; } if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "get_join_rsp: Control direct VCC closed\n"); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "LE_JOIN_RESPONSE over Control direct VCC\n"); } if (FD_ISSET(dist->fd, &rfds)) { --- 486,498 ---- frame_size = recv_frame(lec_params.ctrl_direct, buff, buffsize); if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_join_rsp: recv_frame: %s", strerror(errno)); return -1; } if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "get_join_rsp: Control direct VCC closed"); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "LE_JOIN_RESPONSE over Control direct VCC"); } if (FD_ISSET(dist->fd, &rfds)) { *************** *** 502,509 **** lec_params.ctrl_dist = accept_conn(lec_params.ctrl_listen); if (lec_params.ctrl_dist == NULL) { ! diag(COMPONENT, DIAG_ERROR, "accept of Ctrl distribute failed\n"); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "Closing listen socket for Ctrl distribute VCC\n"); close_connection(lec_params.ctrl_listen); lec_params.ctrl_listen = NULL; --- 502,509 ---- lec_params.ctrl_dist = accept_conn(lec_params.ctrl_listen); if (lec_params.ctrl_dist == NULL) { ! diag(COMPONENT, DIAG_ERROR, "accept of Ctrl distribute failed"); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "Closing listen socket for Ctrl distribute VCC"); close_connection(lec_params.ctrl_listen); lec_params.ctrl_listen = NULL; *************** *** 515,527 **** frame_size = recv_frame(lec_params.ctrl_dist, buff, buffsize); if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_join_rsp: recv_frame: %s\n", strerror(errno)); return -1; } if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "Control distribute VCC closed\n"); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "LE_JOIN_RESPONSE over Control distribute VCC\n"); } --- 515,527 ---- frame_size = recv_frame(lec_params.ctrl_dist, buff, buffsize); if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_join_rsp: recv_frame: %s", strerror(errno)); return -1; } if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "Control distribute VCC closed"); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "LE_JOIN_RESPONSE over Control distribute VCC"); } *************** *** 537,541 **** struct ctrl_frame *frame; ! diag(COMPONENT, DIAG_DEBUG, "Parsing LE_JOIN_RESPONSE\n"); if (validate_frame(buff, size) < 0) return -1; --- 537,541 ---- struct ctrl_frame *frame; ! diag(COMPONENT, DIAG_DEBUG, "Parsing LE_JOIN_RESPONSE"); if (validate_frame(buff, size) < 0) return -1; *************** *** 546,550 **** if (frame->header.status != 0) { ! diag(COMPONENT, DIAG_ERROR, "LES said: %s\n", status2text(frame->header.status)); return -1; --- 546,550 ---- if (frame->header.status != 0) { ! diag(COMPONENT, DIAG_ERROR, "LES said: %s", status2text(frame->header.status)); return -1; *************** *** 561,565 **** if (!(frame->header.flags & htons(V2_REQUIRED)) && lec_params.c29_v2_capable) { ! diag(COMPONENT, DIAG_INFO, "LES did not return V2 Required Flag, acting as V1 client\n"); lec_params.c29_v2_capable = 0; } --- 561,565 ---- if (!(frame->header.flags & htons(V2_REQUIRED)) && lec_params.c29_v2_capable) { ! diag(COMPONENT, DIAG_INFO, "LES did not return V2 Required Flag, acting as V1 client"); lec_params.c29_v2_capable = 0; } *************** *** 567,571 **** (lec_params.c3_max_frame_size == MTU_1580)) { /* Against spec, but we'll accept the MTU and clear the flag */ ! diag(COMPONENT, DIAG_ERROR, "LES not LANEv2 but uses MTU of 1580 bytes\n"); lec_params.c29_v2_capable = 0; } --- 567,571 ---- (lec_params.c3_max_frame_size == MTU_1580)) { /* Against spec, but we'll accept the MTU and clear the flag */ ! diag(COMPONENT, DIAG_ERROR, "LES not LANEv2 but uses MTU of 1580 bytes"); lec_params.c29_v2_capable = 0; } *************** *** 610,619 **** retval = send_frame(lec_params.ctrl_direct, frame, sizeof(struct ctrl_frame)); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "LE_ARP_REQUEST for BUS failed\n"); return -1; } retval = get_bus_addr(&bus_addr); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "LE_ARP_RESPONSE for BUS failed\n"); return -1; } else if (retval > 0) --- 610,619 ---- retval = send_frame(lec_params.ctrl_direct, frame, sizeof(struct ctrl_frame)); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "LE_ARP_REQUEST for BUS failed"); return -1; } retval = get_bus_addr(&bus_addr); if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "LE_ARP_RESPONSE for BUS failed"); return -1; } else if (retval > 0) *************** *** 622,626 **** } if (tries == 0) { ! diag(COMPONENT, DIAG_ERROR, "LE_ARP_RESPONSE for BUS timed out\n"); return -1; } --- 622,626 ---- } if (tries == 0) { ! diag(COMPONENT, DIAG_ERROR, "LE_ARP_RESPONSE for BUS timed out"); return -1; } *************** *** 634,638 **** lec_params.mcast_listen = create_listensocket(&listen_addr, &sap, &qos); if (lec_params.mcast_listen == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Listen socket for BUS failed\n"); return -1; } --- 634,638 ---- lec_params.mcast_listen = create_listensocket(&listen_addr, &sap, &qos); if (lec_params.mcast_listen == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Listen socket for BUS failed"); return -1; } *************** *** 640,653 **** lec_params.mcast_send = setup_svc(&bus_addr, &listen_addr, &sap, &qos); if (lec_params.mcast_send == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Connect to BUS failed\n"); return -1; } /* Default Multicast send VCC to BUS ready, notify kernel */ if (ioctl(lec_params.mcast_send->fd, ATMLEC_MCAST, lec_params.itf_num) < 0) { ! diag(COMPONENT, DIAG_FATAL, "Can't change socket into LE mcast socket: %s\n", strerror(errno)); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "About to wait for BUS to connect\n"); tv.tv_sec = lec_params.c7_ctrl_timeout; tv.tv_usec = 0; --- 640,653 ---- lec_params.mcast_send = setup_svc(&bus_addr, &listen_addr, &sap, &qos); if (lec_params.mcast_send == NULL) { ! diag(COMPONENT, DIAG_ERROR, "Connect to BUS failed"); return -1; } /* Default Multicast send VCC to BUS ready, notify kernel */ if (ioctl(lec_params.mcast_send->fd, ATMLEC_MCAST, lec_params.itf_num) < 0) { ! diag(COMPONENT, DIAG_FATAL, "Can't change socket into LE mcast socket: %s", stre... [truncated message content] |