You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(164) |
Oct
(104) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(17) |
Jun
|
Jul
(11) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
(8) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
(6) |
2005 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(2) |
Nov
(6) |
Dec
|
2007 |
Jan
|
Feb
(3) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(6) |
Aug
(36) |
Sep
(3) |
Oct
(1) |
Nov
|
Dec
(23) |
2008 |
Jan
(33) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(13) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(32) |
Sep
|
Oct
|
Nov
(14) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(13) |
2011 |
Jan
(16) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: chas w. <ch...@us...> - 2005-04-18 15:49:10
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19177 Modified Files: Tag: V2_5_0 frames.c Log Message: From: "Talbert, Scott" <sco...@lm...> Here is a patch for zeppelin. It did not handle the byte ordering properly for the REMOTE_ADDRESS flag in an LE_ARP response. Thus, the REMOTE_ADDRESS flag would never be set and sent to the kernel. Index: frames.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/frames.c,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** frames.c 19 Jul 2003 22:42:01 -0000 1.2.2.2 --- frames.c 18 Apr 2005 15:49:01 -0000 1.2.2.3 *************** *** 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; *************** *** 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; *************** *** 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); |
From: chas w. <ch...@us...> - 2005-02-13 17:47:38
|
Update of /cvsroot/linux-atm/linux-atm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24189 Modified Files: Tag: V2_5_0 ChangeLog configure.in Log Message: point 2 multipoint signalling Index: ChangeLog =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/ChangeLog,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -C2 -d -r1.2.2.4 -r1.2.2.5 *** ChangeLog 26 Feb 2004 01:10:37 -0000 1.2.2.4 --- ChangeLog 13 Feb 2005 17:47:18 -0000 1.2.2.5 *************** *** 1,3 **** ! Version 2.4.1 to 2.5.0 (??-???-????) ====================== --- 1,3 ---- ! Version 2.4.1 to 2.5.0 (13-FEB-2005) ====================== *************** *** 15,18 **** --- 15,19 ---- - ilmid updates from ek...@cm... - atmswitch from ele...@in... + - point to multipoint signalling support Other changes Index: configure.in =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/configure.in,v retrieving revision 1.2.2.6 retrieving revision 1.2.2.7 diff -C2 -d -r1.2.2.6 -r1.2.2.7 *** configure.in 25 Sep 2004 12:17:22 -0000 1.2.2.6 --- configure.in 13 Feb 2005 17:47:22 -0000 1.2.2.7 *************** *** 161,164 **** --- 161,182 ---- fi + pmp_send="" + AC_SUBST(pmp_send) + AC_ARG_ENABLE(multipoint, + [ --enable-multipoint Enable point to multipoint signalling], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT + #include <sys/ioctl.h> + #include <linux/atmdev.h> + ], + [[ int fd; + struct atm_iobuf buf; + + ioctl(fd, ATM_ADDPARTY, &buf); + ]])], + [AC_DEFINE(MULTIPOINT, [], [Point to multipoint signalling support for atmsigd.]) + pmp_send="pmp_send"], + [AC_MSG_WARN([*** Multipoint signalling was not enabled. Missing kernel support?])], + [AC_MSG_WARN([*** Multipoint signalling was not enabled. Can't test when cross-compiling.])]) + ]) dnl Xsed="sed -e s/^X//" |
From: chas w. <ch...@us...> - 2005-02-13 17:47:38
|
Update of /cvsroot/linux-atm/linux-atm/src/sigd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24189/src/sigd Modified Files: Tag: V2_5_0 kernel.c proto.c proto.h sap.c timeout.c timeout.h uni.c Log Message: point 2 multipoint signalling Index: kernel.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/kernel.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** kernel.c 9 Oct 2001 22:33:07 -0000 1.2 --- kernel.c 13 Feb 2005 17:47:22 -0000 1.2.2.1 *************** *** 31,34 **** --- 31,139 ---- + #ifdef MULTIPOINT + int send_dropparty(SOCKET *sock) + { + Q_DSC dsc; + int size; + + q_create(&dsc, q_buffer, MAX_Q_MSG); + q_assign(&dsc, QF_msg_type, ATM_MSG_DROP_PARTY); + q_assign(&dsc, QF_call_ref, sock->call_ref); + q_assign(&dsc, QF_ep_ref, sock->ep_ref); + q_assign(&dsc, QF_cause, ATM_CV_NORMAL_UNSPEC); + if ((size = q_close(&dsc)) < 0) + return -EINVAL; + + to_signaling(sock->sig, q_buffer, size); + START_TIMER(sock, T398); + return 0; + } + + + int send_addparty(SOCKET *sock, struct sockaddr_atmsvc *svc) + { + SOCKET *walk = NULL; + Q_DSC dsc; + struct sockaddr_atmsvc *local = NULL; + int error = 0,size,max_ep_ref = 0; + char buf[80]; + + diag(COMPONENT, DIAG_INFO, "send_addparty"); + q_create(&dsc,q_buffer,MAX_Q_MSG); + + /* think this next line is already done */ + /* sock->sig = route_remote(&sock->remote); */ + + /* set the calling party address */ + if (sock->sig && sock->sig->mode == sm_switch) local = &sock->local; + if (atmsvc_addr_in_use(sock->local) && !local) { + sock->sig = route_local(&sock->local); + if (sock->sig) local = &sock->local; + else { + error = -EADDRNOTAVAIL; + diag(COMPONENT,DIAG_WARN,"local address no longer available"); + } + } + else { + if (!sock->sig) error = -EHOSTUNREACH; + else { + if (!local) local = get_local(sock->sig); + if (!local) local = get_local(NULL); + if (local) sock->local = *local; + else { + error = -EADDRNOTAVAIL; + diag(COMPONENT,DIAG_ERROR,"no local address"); + } + } + } + if (local) { + if (*local->sas_addr.pub) { + q_assign(&dsc,QF_cgpn_plan,ATM_NP_E164); + q_assign(&dsc,QF_cgpn_type,ATM_TON_INTRNTNL); + q_write(&dsc,QF_cgpn,(void *) local->sas_addr.pub, + strlen(local->sas_addr.pub)); + } + else { + q_assign(&dsc,QF_cgpn_plan,ATM_NP_AEA); + q_assign(&dsc,QF_cgpn_type,ATM_TON_UNKNOWN); + q_write(&dsc,QF_cgpn,(void *) local->sas_addr.prv,ATM_ESA_LEN); + } + } + + /* what to do if error == -EADDRNOTAVAIL ? */ + + /* find the largest endpoint reference in the list */ + for (walk = sockets; walk->next; walk = walk->next) { + if ((walk->call_ref == sock->call_ref) && + (walk->ep_ref > max_ep_ref)) max_ep_ref = walk->ep_ref; + } + sock->ep_ref = max_ep_ref + 1; + + q_assign(&dsc,QF_call_ref,sock->call_ref); + q_assign(&dsc,QF_aal_type,5); /* AAL 5 */ + q_assign(&dsc,QF_msg_type,ATM_MSG_ADD_PARTY); + + diag(COMPONENT, DIAG_INFO, "send_addparty: sap_encode"); + if (atm2text(buf,MAX_ATM_ADDR_LEN+1,(struct sockaddr *)svc, pretty) >= 0) + diag(COMPONENT, DIAG_INFO, "send_addparty -> %s", buf); + else + diag(COMPONENT, DIAG_INFO, "send_addparty: invalid nsap address"); + error = sap_encode(&dsc,svc,&sock->sap,NULL,sock->sig->uni,sock->sig->max_rate); + diag(COMPONENT, DIAG_INFO, "send_addparty: sap_encode error = %d", error); + + q_assign(&dsc, QF_ep_ref, sock->ep_ref); + error = 0; + if ((size = q_close(&dsc)) < 0) { + error = -EINVAL; + } else if (!error) { + to_signaling(sock->sig,q_buffer,size); + new_state(sock,ss_connecting); + return sock->ep_ref; + } + return error; + } + #endif + + static int send_setup(SOCKET *sock) { *************** *** 97,101 **** --- 202,218 ---- sock->sig->uni,sock->sig->max_rate); q_assign(&dsc,QF_bearer_class,16); /* BCOB-X */ + #ifndef MULTIPOINT q_assign(&dsc,QF_upcc,0); /* p2p */ + #else + if (sock->ct == p2p) { + diag(COMPONENT, DIAG_INFO, "setting configuration to point-to-point"); + q_assign(&dsc,QF_upcc,0); /* p2p */ + } else if (sock->ct == p2mp) { + diag(COMPONENT, DIAG_INFO, "setting configuration to multipoint"); + q_assign(&dsc, QF_upcc, 1); /* p2mp */ + q_assign(&dsc, QF_ep_ref, 0); /* initial setup always leaf 0 */ + sock->ep_ref = 0; + } + #endif #if !defined(UNI30) || defined(DYNAMIC_UNI) if (!error && sock->sig->uni != S_UNI30) *************** *** 231,234 **** --- 348,356 ---- sock->state = ss_connecting; sock->pvc = msg->pvc; + #ifdef MULTIPOINT + sock->ct = p2p; + if (msg->session > 0) + sock->ct = p2mp; + #endif error = send_setup(sock); if (error) { *************** *** 314,318 **** send_close(sock); /* fall through */ ! case ss_wait_close: free_sock(sock); /* fall through */ --- 436,440 ---- send_close(sock); /* fall through */ ! case ss_wait_close: /* network requested close */ free_sock(sock); /* fall through */ *************** *** 359,362 **** --- 481,485 ---- case ss_rel_ind: send_release_complete(sock->sig,sock->call_ref,0); /* @@@ */ + diag(COMPONENT, DIAG_INFO, "ss_rel_ind"); free_sock(sock); return; *************** *** 479,482 **** --- 602,685 ---- } #endif + #ifdef MULTIPOINT + case as_dropparty: { + int leaves; + + /* This should send a RELEASE if there is only + * one party left on the call + */ + + if (sock == NULL) { + /* leaf was probably not found */ + send_kernel(msg->vcc, kptr_null, as_dropparty, -1, + NULL, NULL, NULL, NULL, NULL); + return; + } + leaves = count_leaves(&sock->id); + if ((sock->state == ss_connected) || + (sock->state == ss_connecting)) { + /* rely on short circuit boolean eval */ + if ((leaves > 1) && (send_dropparty(sock) < 0)) { + send_kernel(sock->id, kptr_null, as_error, 0, + NULL, NULL, NULL, NULL, NULL); + } else if (leaves > 1) { + new_state(sock, ss_rel_req); + } else if (leaves == 1) { + send_release(sock, sock->sig->uni + != S_UNI30 ? ATM_CV_NORMAL_CLEAR : + ATM_CV_NORMAL_UNSPEC); + } + } else { + send_kernel(sock->id, kptr_null, as_error, 0, + NULL, NULL, NULL, NULL, NULL); + } + return; + } + + case as_addparty: + { + int leafid = -1; + SOCKET *ns = NULL; + + if (sock == NULL) { + diag(COMPONENT, DIAG_INFO, + "*sock is null. Not adding party."); + } else { + /* Create a new socket for keeping state information + * that has the same "id" and call reference value + * as *sock, but should have a different endpoint + * reference. Need to make sure that all routines + * that search for SOCKETS by id also compare endpoint + * references */ + + ns = new_sock(msg->vcc); + ns->call_ref = sock->call_ref; + + ns->local = msg->local; + ns->remote = msg->svc; + ns->qos = msg->qos; + ns->sap = msg->sap; + ns->state = ss_connecting; + ns->pvc = msg->pvc; + ns->sig = route_remote(&ns->remote); + leafid = send_addparty(ns, &msg->svc); + START_TIMER(ns,T399); + } + + if (leafid > 0) { + /* don't do anything here because we will notify + * the kernel of success or failure after the + * network responds with ATM_MSG_ADD_PARTY_ACK or + * ATM_MSG_ADD_PARTY_REJ */ + } else { + /* notify kernel of failure because the addparty + * request was never sent */ + diag(COMPONENT, DIAG_INFO, "send_addparty failed"); + send_kernel(ns->id, kptr_null, as_error, 0, + NULL, NULL, NULL, NULL, NULL); + } + return; + } + #endif default: diag(COMPONENT,DIAG_WARN,"invalid message %d",(int) msg->type); *************** *** 578,581 **** --- 781,795 ---- break; } + #ifdef MULTIPOINT + else if (msg->type == as_dropparty) { + /* check the endpoint reference while we search */ + dispatcher = dispatch; + for (curr = sockets; curr; curr = curr->next) { + if (kptr_eq(&msg->vcc, &curr->id) && + (curr->ep_ref == msg->reply)) break; + } + if (curr == NULL) diag(COMPONENT, DIAG_INFO, "leaf not found"); + } + #endif else { dispatcher = dispatch; Index: proto.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/proto.c,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** proto.c 10 Dec 2004 17:54:50 -0000 1.2.2.2 --- proto.c 13 Feb 2005 17:47:22 -0000 1.2.2.3 *************** *** 43,47 **** const char *as_name[] = { "<invalid>","as_bind","as_connect","as_accept", "as_reject","as_listen","as_okay","as_error","as_indicate","as_close", ! "as_itf_notify","as_modify","as_identify","as_terminate" }; const CALL_STATE state_map[] = { /* formatting aligned with STATE */ --- 43,51 ---- const char *as_name[] = { "<invalid>","as_bind","as_connect","as_accept", "as_reject","as_listen","as_okay","as_error","as_indicate","as_close", ! "as_itf_notify","as_modify","as_identify","as_terminate", ! #ifdef MULTPOINT ! "as_addparty", "as_dropparty", ! #endif ! }; const CALL_STATE state_map[] = { /* formatting aligned with STATE */ *************** *** 121,124 **** --- 125,157 ---- } + #ifdef MULTIPOINT + /* don't call free_sock() after free_leaves() -- this function frees the + * root node as well */ + void free_leaves(atm_kptr_t *id) + { + SOCKET **walk = &sockets, *target = NULL; + while (*walk != NULL) { + target = *walk; + walk = &((*walk)->next); + if (kptr_eq(&target->id, id)) { + diag(COMPONENT, DIAG_INFO, "freeing leaf %s:%d", + kptr_print(&target->id), target->ep_ref); + free_sock(target); + } + } + } + + int count_leaves(atm_kptr_t *id) + { + SOCKET *walk = sockets; + + int count = 0; + if (walk) + for (; walk; walk = walk->next) + if(kptr_eq(&walk->id, id)) + count++; + return count; + } + #endif void new_state(SOCKET *sock,STATE state) Index: proto.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/proto.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** proto.h 9 Oct 2001 22:33:07 -0000 1.2 --- proto.h 13 Feb 2005 17:47:22 -0000 1.2.2.1 *************** *** 14,17 **** --- 14,20 ---- #include "saal.h" + #ifdef MULTIPOINT + typedef enum { p2p, p2mp } CALL_TYPE; + #endif typedef enum { /* formatting aligned with state_map and others */ *************** *** 79,82 **** --- 82,88 ---- struct sockaddr_atmsvc local; /* local address */ struct sockaddr_atmsvc remote; /* remote address */ + #ifdef MULTIPOINT + CALL_TYPE ct; + #endif struct atm_sap sap; /* SAP (BHLI and BLLI) */ struct atm_qos qos; /* QOS parameters */ *************** *** 153,156 **** --- 159,164 ---- SOCKET *new_sock(atm_kptr_t id); void free_sock(SOCKET *sock); + void free_leaves(atm_kptr_t *id); + int count_leaves(atm_kptr_t *id); void new_state(SOCKET *sock,STATE state); SOCKET *lookup_sap(const struct sockaddr_atmsvc *addr, Index: sap.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/sap.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** sap.c 9 Oct 2001 22:33:07 -0000 1.2 --- sap.c 13 Feb 2005 17:47:22 -0000 1.2.2.1 *************** *** 143,146 **** --- 143,147 ---- q_write(dsc,QF_cdpn_esa,(void *) addr->sas_addr.prv,ATM_ESA_LEN); else return -EDESTADDRREQ; + if (qos) { if (qos->txtp.traffic_class == ATM_UBR || qos->rxtp.traffic_class == ATM_UBR) { *************** *** 196,199 **** --- 197,201 ---- q_assign(dsc,QF_bw_max_sdu,qos->rxtp.max_sdu); } + } /* @@@ bearer class ? */ /* @@@ QOS class ? */ Index: timeout.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/timeout.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** timeout.c 9 Oct 2001 22:33:07 -0000 1.2 --- timeout.c 13 Feb 2005 17:47:22 -0000 1.2.2.1 *************** *** 30,33 **** --- 30,57 ---- } + #ifdef MULTIPOINT + void on_T398(void *user) /* DROPPARTY */ + { + SOCKET *sock = user; + + if (sock == NULL) return; + SEND_ERROR(sock->id, -ETIMEDOUT); + /* should retry once and then give up */ + sock->conn_timer = NULL; + free_sock(sock); + } + + void on_T399(void *user) /* ADDPARTY */ + { + SOCKET *sock = user; + + if (sock == NULL) return; + diag(COMPONENT,DIAG_INFO,"Timer T399 expired in state %s", + state_name[sock->state]); + SEND_ERROR(sock->id, -ETIMEDOUT); + sock->conn_timer = NULL; + free_sock(sock); + } + #endif void on_T303(void *user) /* CONNECTING */ Index: timeout.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/timeout.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** timeout.h 9 Oct 2001 22:33:07 -0000 1.2 --- timeout.h 13 Feb 2005 17:47:22 -0000 1.2.2.1 *************** *** 16,20 **** #define T360_TIME 30000000 /* 30 sec */ #define T361_TIME 20000000 /* 20 sec */ ! #define START_TIMER(u,t) { assert(!u->conn_timer); \ --- 16,21 ---- #define T360_TIME 30000000 /* 30 sec */ #define T361_TIME 20000000 /* 20 sec */ ! #define T399_TIME 14000000 /* 14 sec */ ! #define T398_TIME 4000000 /* 4 sec */ #define START_TIMER(u,t) { assert(!u->conn_timer); \ *************** *** 23,26 **** --- 24,29 ---- + void on_T398(void *user); + void on_T399(void *user); void on_T303(void *user); void on_T308_1(void *user); Index: uni.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/uni.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** uni.c 9 Oct 2001 22:33:07 -0000 1.2 --- uni.c 13 Feb 2005 17:47:22 -0000 1.2.2.1 *************** *** 517,521 **** case ss_wait_rel: STOP_TIMER(sock); ! free_sock(sock); return; #if defined(Q2963_1) || defined(DYNAMIC_UNI) --- 517,527 ---- case ss_wait_rel: STOP_TIMER(sock); ! #ifdef MULTIPOINT ! /* Need to free all endpoints if this is a pmp call */ ! if (sock->ct == p2mp) ! free_leaves(&sock->id); ! else ! #endif ! free_sock(sock); return; #if defined(Q2963_1) || defined(DYNAMIC_UNI) *************** *** 574,577 **** --- 580,623 ---- /* silently ignore this junk */ return; + #ifdef MULTIPOINT + case ATM_MSG_ADD_PARTY_REJ: + STOP_TIMER(sock); + send_drop_party_ack(sock->sig,sock->call_ref,sock->ep_ref,ATM_CV_CALL_REJ); + send_kernel(sock->id, kptr_null, as_addparty, -1, + NULL, NULL, NULL, NULL, NULL); + diag(COMPONENT, DIAG_INFO, "addparty failed"); + /* If no other leaves, should close entire call */ + free_sock(sock); + return; + case ATM_MSG_ADD_PARTY_ACK: + STOP_TIMER(sock); + send_kernel(sock->id, kptr_null, as_addparty, sock->ep_ref, + NULL, NULL, NULL, NULL, NULL); + diag(COMPONENT, DIAG_INFO, "addparty succeeded"); + new_state(sock, ss_connected); + return; + case ATM_MSG_DROP_PARTY_ACK: + STOP_TIMER(sock); + send_kernel(sock->id, kptr_null, as_dropparty, 0, + NULL, NULL, NULL, NULL, NULL); + diag(COMPONENT, DIAG_INFO, "dropparty succeeded"); + free_sock(sock); + return; + case ATM_MSG_DROP_PARTY: + diag(COMPONENT, DIAG_INFO, "received dropparty"); + switch (sock->state) { + case ss_connecting: + case ss_connected: + case ss_rel_req: + case ss_wait_rel: + send_drop_party_ack(sock->sig, sock->call_ref, sock->ep_ref, + ATM_CV_NORMAL_CLEAR); + break; + default: + send_drop_party_ack(sock->sig, sock->call_ref, sock->ep_ref, 0); + } + free_sock(sock); + return; + #endif #if defined(Q2963_1) || defined(DYNAMIC_UNI) /* *************** *** 706,709 **** --- 752,756 ---- SOCKET *curr; unsigned long call_ref; + unsigned short ep_ref; unsigned char mid; *************** *** 752,757 **** return; } ! for (curr = sockets; curr; curr = curr->next) ! if (curr->sig == sig && curr->call_ref == call_ref) break; diag(COMPONENT,DIAG_DEBUG,"FROM SAAL %d.%d.%d: %s (0x%02X) CR 0x%06lx for " "%s",S_PVC(sig),mid2name(((unsigned char *) msg)[5]), --- 799,814 ---- return; } ! ! #ifdef MULTIPOINT ! if (q_present(&in_dsc,QF_ep_ref)) { ! ep_ref = cvt_ep_ref(sig,q_fetch(&in_dsc,QF_ep_ref)); ! for (curr = sockets; curr; curr = curr->next) ! if (curr->sig == sig && ! curr->call_ref == call_ref && ! curr->ep_ref == ep_ref) break; ! } else ! #endif ! for (curr = sockets; curr; curr = curr->next) ! if (curr->sig == sig && curr->call_ref == call_ref) break; diag(COMPONENT,DIAG_DEBUG,"FROM SAAL %d.%d.%d: %s (0x%02X) CR 0x%06lx for " "%s",S_PVC(sig),mid2name(((unsigned char *) msg)[5]), *************** *** 767,772 **** if (curr && q_present(&in_dsc,QF_ep_ref) && mid != ATM_MSG_ADD_PARTY && mid != ATM_MSG_DROP_PARTY_ACK) { - unsigned short ep_ref; - ep_ref = cvt_ep_ref(sig,q_fetch(&in_dsc,QF_ep_ref)); if (curr->ep_ref != ep_ref) { --- 824,827 ---- |
From: chas w. <ch...@us...> - 2005-01-06 21:44:20
|
Update of /cvsroot/linux-atm/linux-atm/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22328 Modified Files: Tag: V2_5_0 diag.c Log Message: add timestamps when writing to a logfile Index: diag.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/lib/diag.c,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** diag.c 1 May 2003 13:23:18 -0000 1.2.2.1 --- diag.c 6 Jan 2005 21:44:11 -0000 1.2.2.2 *************** *** 12,15 **** --- 12,17 ---- #include <string.h> #include <syslog.h> + #include <signal.h> + #include <time.h> #include "atmd.h" *************** *** 127,131 **** --- 129,137 ---- FILE *to; char buffer[MAX_DIAG_MSG+1]; + struct timeval tv; int i; + #define DATESTR_LEN 32 + char datestr[DATESTR_LEN]; + struct tm tm; for (walk = components; walk; walk = walk->next) *************** *** 140,145 **** } else { ! if (app_name) fprintf(to,"%s:%s: ",app_name,component); ! else fprintf(to,"%s: ",component); vfprintf(to,fmt,ap); fputc('\n',to); --- 146,157 ---- } else { ! gettimeofday(&tv,NULL); ! localtime_r((time_t *) &tv.tv_sec, &tm); ! strftime(datestr, DATESTR_LEN, "%b %d %T", &tm); ! if (app_name) ! fprintf(to, "%s.%06lu %s:%s: ", ! datestr, (unsigned long) tv.tv_usec, app_name, component); ! else ! fprintf(to,"%s.%06lu %s: ", datestr, (unsigned long) tv.tv_usec, component); vfprintf(to,fmt,ap); fputc('\n',to); |
From: chas w. <ch...@us...> - 2004-12-11 01:57:25
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6667 Modified Files: Tag: V2_5_0 conn.c main.c Log Message: dont close the kernel connection -- this will prevent kernel messages about zeppelin not being attached during restarts. Index: conn.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/conn.c,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** conn.c 19 Jul 2003 22:42:01 -0000 1.2.2.3 --- conn.c 11 Dec 2004 01:57:11 -0000 1.2.2.4 *************** *** 434,438 **** } ! /* Close all connections, important or not. */ void close_connections(void) --- 434,438 ---- } ! /* Close all connections, except the kernel socket. */ void close_connections(void) *************** *** 441,450 **** for(conn = connlist; conn; conn = next) { ! diag(COMPONENT, DIAG_DEBUG, "Destroying:%p fd:%d type:%d", ! 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); ! } } Index: main.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/main.c,v retrieving revision 1.2.2.5 retrieving revision 1.2.2.6 diff -C2 -d -r1.2.2.5 -r1.2.2.6 *** main.c 10 Dec 2004 21:06:37 -0000 1.2.2.5 --- main.c 11 Dec 2004 01:57:11 -0000 1.2.2.6 *************** *** 370,373 **** --- 370,419 ---- signal(SIGPIPE, SIG_IGN); + if (!esi_set) { + if(addr_getesi(mac_addr, phys_itf) < 0) { + diag(COMPONENT, DIAG_ERROR, "Can't get ESI from kernel!"); + return -1; + } + mac2text(esibuff, mac_addr); + diag(COMPONENT, DIAG_DEBUG, "LEC ESI:%s", esibuff); + + if (itf != 0) + mac_addr[0] = 0x2 | ((itf - 1) << 2); + } + + if ((itf = kernel_init(mac_addr, itf)) < 0 ) { + diag(COMPONENT, DIAG_FATAL, "Kernel interface creation failed, exiting..."); + return -1; + } + + if (daemon_flag == 1) { + daemon_flag = 0; + pid = fork(); + if (pid < 0) { + diag(COMPONENT, DIAG_FATAL, "fork failed, exiting..."); + return -1; + } + if (pid) { + /* parent */ + return 0; + } else { + /* child */ + if (setsid() < 0) { + diag(COMPONENT, DIAG_FATAL, "setsid failed, exiting..."); + return -1; + } + } + } + + sprintf(pidbuf, "/var/run/lec%d.pid", itf); + fd = open(pidbuf, O_CREAT | O_WRONLY, 0600); + if (fd < 0) { + diag(COMPONENT, DIAG_FATAL, "open(%s, ..) failed, %s", pidbuf, strerror(errno)); + return -1; + } + sprintf(pidbuf, "%d\n", getpid()); + write(fd, pidbuf, strlen(pidbuf)); + close(fd); + /* Loop here until the Sun gets cold */ while (1) { *************** *** 385,434 **** diag(COMPONENT, DIAG_INFO, "Our ATM address: %s", atm2textbuff); - if (!esi_set) { - if(addr_getesi(mac_addr, phys_itf) < 0) { - diag(COMPONENT, DIAG_ERROR, "Can't get ESI from kernel!"); - return -1; - } - mac2text(esibuff, mac_addr); - diag(COMPONENT, DIAG_DEBUG, "LEC ESI:%s", esibuff); - - if (itf != 0) - mac_addr[0] = 0x2 | ((itf - 1) << 2); - } - - if ((itf = kernel_init(mac_addr, itf)) < 0 ) { - diag(COMPONENT, DIAG_FATAL, "Kernel interface creation failed, exiting..."); - return -1; - } - - if (daemon_flag == 1) { - daemon_flag = 0; - pid = fork(); - if (pid < 0) { - diag(COMPONENT, DIAG_FATAL, "fork failed, exiting..."); - return -1; - } - if (pid) { - /* parent */ - return 0; - } else { - /* child */ - if (setsid() < 0) { - diag(COMPONENT, DIAG_FATAL, "setsid failed, exiting..."); - return -1; - } - } - } - - sprintf(pidbuf, "/var/run/lec%d.pid", itf); - fd = open(pidbuf, O_CREAT | O_WRONLY, 0600); - if (fd < 0) { - diag(COMPONENT, DIAG_FATAL, "open(%s, ..) failed, %s", pidbuf, strerror(errno)); - return -1; - } - sprintf(pidbuf, "%d\n", getpid()); - write(fd, pidbuf, strlen(pidbuf)); - close(fd); - diag(COMPONENT, DIAG_DEBUG, "initializing lec parameters"); init_lec_params(mac_addr, elan_name, listen_addr.sas_addr.prv, --- 431,434 ---- |
From: chas w. <ch...@us...> - 2004-12-10 21:06:50
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10062 Modified Files: Tag: V2_5_0 main.c Log Message: keep the mac address unique when you have multiple interfaces Index: main.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/main.c,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -C2 -d -r1.2.2.4 -r1.2.2.5 *** main.c 10 Dec 2004 18:12:33 -0000 1.2.2.4 --- main.c 10 Dec 2004 21:06:37 -0000 1.2.2.5 *************** *** 392,395 **** --- 392,398 ---- mac2text(esibuff, mac_addr); diag(COMPONENT, DIAG_DEBUG, "LEC ESI:%s", esibuff); + + if (itf != 0) + mac_addr[0] = 0x2 | ((itf - 1) << 2); } |
From: chas w. <ch...@us...> - 2004-12-10 18:12:50
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2988 Modified Files: Tag: V2_5_0 main.c Log Message: an async remote close can cause SIGPIPE Index: main.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/main.c,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** main.c 19 Jul 2003 22:42:01 -0000 1.2.2.3 --- main.c 10 Dec 2004 18:12:33 -0000 1.2.2.4 *************** *** 368,371 **** --- 368,372 ---- /* Reserve signals */ signal(SIGHUP, sig_reset); + signal(SIGPIPE, SIG_IGN); /* Loop here until the Sun gets cold */ |
From: chas w. <ch...@us...> - 2004-12-10 17:55:00
|
Update of /cvsroot/linux-atm/linux-atm/src/sigd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31027 Modified Files: Tag: V2_5_0 proto.c Log Message: fix compiler warning Index: proto.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/proto.c,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** proto.c 25 Sep 2004 11:32:32 -0000 1.2.2.1 --- proto.c 10 Dec 2004 17:54:50 -0000 1.2.2.2 *************** *** 263,267 **** break; } - default: } va_end(ap); --- 263,266 ---- *************** *** 292,296 **** } break; - default: } va_end(ap); --- 291,294 ---- |
From: chas w. <ch...@us...> - 2004-12-10 17:48:22
|
Update of /cvsroot/linux-atm/linux-atm/src/maint In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29793 Modified Files: Tag: V2_5_0 enitune.c Log Message: fix compiler warning Index: enitune.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/maint/enitune.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** enitune.c 9 Oct 2001 22:33:07 -0000 1.2 --- enitune.c 10 Dec 2004 17:48:12 -0000 1.2.2.1 *************** *** 44,48 **** if (*end || mult.rx <= 100) usage(name); break; - default: } if (argc != optind+1) usage(name); --- 44,47 ---- |
From: chas w. <ch...@us...> - 2004-12-10 17:47:08
|
Update of /cvsroot/linux-atm/linux-atm/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29381 Modified Files: Tag: V2_5_0 sapequal.c Log Message: fix compiler warning Index: sapequal.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/lib/sapequal.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** sapequal.c 9 Oct 2001 22:33:07 -0000 1.2 --- sapequal.c 10 Dec 2004 17:46:56 -0000 1.2.2.1 *************** *** 65,69 **** CHECK(l2.itu.window,a.l2.itu.window > b.l2.itu.window); break; - default: } switch (a.l3_proto) { --- 65,68 ---- *************** *** 83,87 **** if (a.l3.user != b.l3.user) return 0; break; - default: } return 1; --- 82,85 ---- |
From: chas w. <ch...@us...> - 2004-10-28 13:59:09
|
Update of /cvsroot/linux-atm/linux-atm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16795 Modified Files: Tag: V2_5_0 COPYING Log Message: updated the paths that changed during the reorganization of the source code Index: COPYING =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/COPYING,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** COPYING 20 Aug 2001 21:03:47 -0000 1.1 --- COPYING 28 Oct 2004 13:58:48 -0000 1.1.2.1 *************** *** 1,6 **** Program code, documentation and auxiliary programs, except for the parts ! listen below, are ! Copyright 1995-2000 EPFL-LRC/ICA ! All rights reserved. This package is free software; you can redistribute it and/or modify --- 1,7 ---- Program code, documentation and auxiliary programs, except for the parts ! listen below, are: ! ! Copyright 1995-2000 EPFL-LRC/ICA ! All rights reserved. This package is free software; you can redistribute it and/or modify *************** *** 18,23 **** in the top-level directory of the kernel (i.e. the GPL, version 2). ! The libraries libatm, libatmd, libarequipa (in atm/lib/), libsaal (in ! atm/saal/), and qlib (in atm/qgen/) are covered by the more permissive Library General Public License. See the file COPYING.LGPL for details. --- 19,24 ---- in the top-level directory of the kernel (i.e. the GPL, version 2). ! The libraries libatm, libatmd, libarequipa (in src/lib/), libsaal (in ! src/saal/), and qlib (in src/qgen/) are covered by the more permissive Library General Public License. See the file COPYING.LGPL for details. *************** *** 32,40 **** Some of the files used by ilmid are Copyright (C) 1992 Michael Sample and the University of British Columbia ! See asn1/*.[ch] for copying terms. The LAN Emulation code is Copyright by Tampere University of Technology ! - Telecommunications Laboratory. See lane/COPYRIGHT.TUT and ! led/COPYRIGHT.TUT for copying terms. The Multi-Protocol Over ATM (MPOA) code was developed at Tampere --- 33,41 ---- Some of the files used by ilmid are Copyright (C) 1992 Michael Sample and the University of British Columbia ! See src/ilmid/asn1/*.[ch] for copying terms. The LAN Emulation code is Copyright by Tampere University of Technology ! - Telecommunications Laboratory. See src/lane/COPYRIGHT.TUT and ! src/led/COPYRIGHT.TUT for copying terms. The Multi-Protocol Over ATM (MPOA) code was developed at Tampere |
From: chas w. <ch...@us...> - 2004-09-26 12:07:17
|
Update of /cvsroot/linux-atm/linux-atm/src/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28846 Modified Files: Tag: V2_5_0 Makefile.am Added Files: Tag: V2_5_0 svc_recv.c svc_send.c Log Message: svc examples program from ek...@cm... --- NEW FILE: svc_recv.c --- #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> #include <sys/ioctl.h> #include <atm.h> #include <linux/atmdev.h> #define BHLI_MAGIC "FORE_ATM" #define NUMPDUS 50000 static void usage(const char *name) { fprintf(stderr, "usage: %s [<nsap> [<selector> [<qos>]]]\n", name); exit(1); } int main(int argc, char **argv) { struct sockaddr_atmsvc addr; struct sockaddr_atmsvc *my_addr; struct atm_qos qos; struct atm_sap sap; int s, i, errcount = 0, fd, rv; int selector = 0; int one = 1; socklen_t len; char *outbuf = (char *) malloc(65535); if (outbuf == NULL) return 1; if ((s = socket(PF_ATMSVC, SOCK_DGRAM, 0)) < 0) { perror("socket"); return 1; } memset(&addr, 0, sizeof(addr)); memset(&qos, 0, sizeof(qos)); memset(&my_addr, 0, sizeof(my_addr)); qos.aal = ATM_AAL5; qos.txtp.traffic_class = ATM_NONE; qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = 65535; /* Usage: svc_recv [local_host_name [selector [qos]]] */ if (argc > 1) { int answer; my_addr = (struct sockaddr_atmsvc *) malloc(sizeof(struct sockaddr_atmsvc)); answer = text2atm(argv[1], (struct sockaddr *) my_addr, sizeof(struct sockaddr_atmsvc), T2A_SVC | T2A_NAME); if (-1 == answer) { fprintf(stderr, "Bad host name: %s\n", argv[1]); usage(argv[0]); } if (argc > 2) { selector = atoi(argv[2]); my_addr->sas_addr.prv[ATM_ESA_LEN - 1] = (char) selector; if (argc > 3) { if (text2qos(argv[3], &qos, 0) < 0) { fprintf(stderr, "Invalid qos.\n"); usage(argv[0]); } } } } memset(&sap, 0, sizeof(sap)); sap.bhli.hl_type = ATM_HL_USER; sap.bhli.hl_length = 8; memcpy(&sap.bhli.hl_info, BHLI_MAGIC, 8); if (setsockopt(s, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0) { perror("setsockopt SO_ATMQOS (1)"); return 1; } if (setsockopt(s, SOL_ATM, SO_ATMSAP, &sap, sizeof(sap)) < 0) { perror("setsockopt SO_ATMSAP"); return 1; } if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) { perror("setsockopt SO_REUSEADDR"); return 1; } if (NULL != my_addr) { int ret; char atm2textbuf[MAX_ATM_ADDR_LEN + 1]; ret = atm2text(atm2textbuf, sizeof(atm2textbuf), (struct sockaddr *) my_addr, A2T_NAME | A2T_PRETTY | A2T_LOCAL); if (-1 == ret) { fprintf(stderr, "Bad host name: %s\n", argv[1]); return 1; } fprintf(stderr, "binding to addr %s\n", atm2textbuf); ret = bind(s, (struct sockaddr *) my_addr, sizeof(struct sockaddr_atmsvc)); if (ret < 0) { perror("bind() said"); return 1; } } if (listen(s, 1) < 0) { perror("listen"); return 1; } len = sizeof(addr); if ((fd = accept(s, (struct sockaddr *) &addr, &len)) < 0) { perror("accept"); return 1; } fprintf(stderr, "receiving %d PDUs\n", NUMPDUS); for (i = 0, errcount = 0, rv = -1; i < NUMPDUS && rv != 0; i++) if ((rv = read(fd, outbuf, 65535)) < 0) errcount++; if (errcount > 0) fprintf(stderr, "read() failed %d out of %d times\n", errcount, NUMPDUS); fprintf(stderr, "received %d PDUs\n", i - 1); if (close(s) < 0) perror("close s"); if (close(fd) < 0) perror("close fd"); exit(0); } --- NEW FILE: svc_send.c --- #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> #include <sys/ioctl.h> #include <atm.h> #include <linux/atmdev.h> #define BHLI_MAGIC "FORE_ATM" #define NUMPDUS 50000 static void usage(const char *name) { fprintf(stderr, "usage: %s <nsap> [<qos>]\n", name); exit(1); } int main(int argc, char **argv) { struct sockaddr_atmsvc addr; struct atm_qos qos; struct atm_sap sap; int s, i, errcount = 0; unsigned long one = 1; char *outbuf = (char *) malloc(8192); if (outbuf == NULL) return 1; if (argc < 2) { fprintf(stderr, "not enough arguments\n"); usage(argv[0]); } if ((s = socket(PF_ATMSVC, SOCK_DGRAM, 0)) < 0) { perror("socket"); return 1; } memset(&addr, 0, sizeof(addr)); if (text2atm(argv[1], (struct sockaddr *) &addr, sizeof(addr), T2A_SVC) < 0) usage(argv[0]); memset(&qos, 0, sizeof(qos)); memset(&sap, 0, sizeof(sap)); sap.bhli.hl_type = ATM_HL_USER; sap.bhli.hl_length = 8; memcpy(&sap.bhli.hl_info, BHLI_MAGIC, 8); if (argc > 2) { if (text2qos(argv[2], &qos, 0) < 0) { fprintf(stderr, "Invalid qos.\n"); return 1; } } else { qos.aal = ATM_AAL5; qos.txtp.traffic_class = ATM_UBR; qos.rxtp.traffic_class = ATM_NONE; qos.txtp.max_sdu = 8192; } if (setsockopt(s, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0) { perror("setsockopt SO_ATMQOS (1)"); return 1; } if (setsockopt(s, SOL_ATM, SO_ATMSAP, &sap, sizeof(sap)) < 0) { perror("setsockopt SO_ATMSAP"); return 1; } if (connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) { perror("connect"); return 1; } fprintf(stderr, "sending %d PDUs of length %d\n", NUMPDUS, qos.txtp.max_sdu); for (i = 0, errcount = 0; i < NUMPDUS; i++) if (write(s, outbuf, qos.txtp.max_sdu) < 0) errcount++; write(s, NULL, 0); if (errcount > 0) fprintf(stderr, "write() failed %d out of %d times\n", errcount, NUMPDUS); if (close(s) < 0) perror("close s"); exit(0); } Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/test/Makefile.am,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** Makefile.am 24 Feb 2004 23:37:24 -0000 1.2.2.2 --- Makefile.am 26 Sep 2004 12:07:06 -0000 1.2.2.3 *************** *** 1,3 **** ! USRPGMS = aread awrite ttcp_atm atmswitch PGMS = align aping br bw isp window bin_PROGRAMS = $(USRPGMS) --- 1,3 ---- ! USRPGMS = aread awrite ttcp_atm atmswitch svc_recv svc_send PGMS = align aping br bw isp window bin_PROGRAMS = $(USRPGMS) *************** *** 9,12 **** --- 9,14 ---- aread_SOURCES = aread.c awrite_SOURCES = awrite.c + svc_recv_SOURCES = svc_recv.c + svc_send_SOURCES = svc_send.c ttcp_atm_SOURCES = ttcp.c |
From: chas w. <ch...@us...> - 2004-09-25 12:17:32
|
Update of /cvsroot/linux-atm/linux-atm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4681 Modified Files: Tag: V2_5_0 configure.in Log Message: allow specification of alternate path for kernel headers Index: configure.in =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/configure.in,v retrieving revision 1.2.2.5 retrieving revision 1.2.2.6 diff -C2 -d -r1.2.2.5 -r1.2.2.6 *** configure.in 26 Feb 2004 01:10:37 -0000 1.2.2.5 --- configure.in 25 Sep 2004 12:17:22 -0000 1.2.2.6 *************** *** 154,157 **** --- 154,165 ---- ) + AC_ARG_WITH(kernel-headers, + [ --with-kernel-headers=path use the kernel headers found at path] + ) + if test "x$with_kernel_headers" != "x"; then + CFLAGS="-I$with_kernel_headers/include $CFLAGS" + fi + + dnl Xsed="sed -e s/^X//" dnl LTLIBOBJS=`echo X"$LIBOBJS" | \$Xsed -e "s,\. [^.]* ,.lo,g;s,\.[^.]*$,.lo,"` |
From: chas w. <ch...@us...> - 2004-09-25 11:32:41
|
Update of /cvsroot/linux-atm/linux-atm/src/sigd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27616 Modified Files: Tag: V2_5_0 proto.c Log Message: initialize new_qos and owner Index: proto.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/proto.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** proto.c 9 Oct 2001 22:33:07 -0000 1.2 --- proto.c 25 Sep 2004 11:32:32 -0000 1.2.2.1 *************** *** 78,81 **** --- 78,85 ---- memset(&sock->pvc,0,sizeof(sock->pvc)); sock->qos.txtp.traffic_class = sock->qos.rxtp.traffic_class = ATM_UBR; + #if defined(Q2963_1) || defined(DYNAMIC_UNI) + memset(&sock->new_qos, 0, sizeof(sock->new_qos)); + sock->owner = 0; + #endif sock->id = id; memset(&sock->local,0,sizeof(sock->local)); |
From: chas w. <ch...@us...> - 2004-09-25 11:25:57
|
Update of /cvsroot/linux-atm/linux-atm/src/sigd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26437 Modified Files: Tag: V2_5_0 cfg_l.l atmsigd.c Log Message: accept ilmi style uni specifications Index: cfg_l.l =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/cfg_l.l,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** cfg_l.l 9 Oct 2001 22:33:07 -0000 1.2 --- cfg_l.l 25 Sep 2004 11:25:48 -0000 1.2.2.1 *************** *** 42,47 **** --- 42,50 ---- <N>sig return TOK_SIG; <N>uni30 return TOK_UNI30; + <N>3.0 return TOK_UNI30; <N>uni31 return TOK_UNI31; + <N>3.1 return TOK_UNI31; <N>uni40 return TOK_UNI40; + <N>4.0 return TOK_UNI40; <N>[qQ].2963.1 return TOK_Q2963_1; <N>mode return TOK_MODE; Index: atmsigd.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/atmsigd.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** atmsigd.c 9 Oct 2001 22:33:07 -0000 1.2 --- atmsigd.c 25 Sep 2004 11:25:48 -0000 1.2.2.1 *************** *** 429,438 **** int uni = 0; /* silence gcc */ ! if (!strcmp(optarg,"uni30")) uni = S_UNI30; ! else if (!strcmp(optarg,"uni31")) uni = S_UNI31; ! else if (!strcmp(optarg,"uni31+uni30")) uni = S_UNI30 | S_UNI31; ! else if (!strcmp(optarg,"uni40")) uni = S_UNI40; ! else if (!strcmp(optarg,"uni40+q.2963.1")) uni = S_UNI40 | S_Q2963_1; else usage(argv[0]); --- 429,438 ---- int uni = 0; /* silence gcc */ ! if (!strcmp(optarg,"uni30") || !strcmp(optarg,"3.0")) uni = S_UNI30; ! else if (!strcmp(optarg,"uni31") || !strcmp(optarg,"3.1")) uni = S_UNI31; ! else if (!strcmp(optarg,"uni31+uni30") || !strcmp(optarg,"3.1+3.0")) uni = S_UNI30 | S_UNI31; ! else if (!strcmp(optarg,"uni40") || !strcmp(optarg,"4.0")) uni = S_UNI40; ! else if (!strcmp(optarg,"uni40+q.2963.1") || !strcmp(optarg,"4.0+q.2963.1")) uni = S_UNI40 | S_Q2963_1; else usage(argv[0]); |
From: chas w. <ch...@us...> - 2004-02-26 15:20:33
|
Update of /cvsroot/linux-atm/linux-atm/src/qgen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12133/src/qgen Modified Files: Tag: V2_5_0 Makefile.am Log Message: necessary to support builds outside the source tree Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/qgen/Makefile.am,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** Makefile.am 2 May 2003 13:47:15 -0000 1.2.2.1 --- Makefile.am 26 Feb 2004 15:04:42 -0000 1.2.2.2 *************** *** 39,43 **** q.out.h q.out.c q.test.c: qgen msg.fmt default.nl ! $(CPP) $(DEFS) - < $(srcdir)/msg.fmt | ./qgen #q40.out.h q40.out.c q40.test.c: qgen uni40 default.nl --- 39,43 ---- q.out.h q.out.c q.test.c: qgen msg.fmt default.nl ! $(CPP) $(DEFS) $(DEFAULT_INCLUDES) - < $(srcdir)/msg.fmt | ./qgen #q40.out.h q40.out.c q40.test.c: qgen uni40 default.nl *************** *** 45,52 **** qd.out.h qd.out.c qd.dump.c: qgen msg.fmt default.nl ! $(CPP) $(DEFS) - < $(srcdir)/msg.fmt | ./qgen -D q.out.o: q.out.c q.out.h qlib.c qlib.h ! $(CC) $(DEFS) $(CFLAGS) -c q.out.c #q40.out.o: q40.out.c q40.out.h qlib.c qlib.h --- 45,52 ---- qd.out.h qd.out.c qd.dump.c: qgen msg.fmt default.nl ! $(CPP) $(DEFS) $(DEFAULT_INCLUDES) - < $(srcdir)/msg.fmt | ./qgen -D q.out.o: q.out.c q.out.h qlib.c qlib.h ! $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(CFLAGS) -c q.out.c #q40.out.o: q40.out.c q40.out.h qlib.c qlib.h *************** *** 54,61 **** qd.dump.o: qd.dump.c qd.out.c qlib.c qlib.h ! $(CC) $(DEFS) $(CFLAGS) -c qd.dump.c qd.dump.standalone.o: qd.dump.c qd.out.c qlib.c qlib.h ! $(CC) $(DEFS) -DSTANDALONE $(CFLAGS) -c qd.dump.c \ -o qd.dump.standalone.o --- 54,61 ---- qd.dump.o: qd.dump.c qd.out.c qlib.c qlib.h ! $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(CFLAGS) -c qd.dump.c qd.dump.standalone.o: qd.dump.c qd.out.c qlib.c qlib.h ! $(CC) $(DEFS) $(DEFAULT_INCLUDES) -DSTANDALONE $(CFLAGS) -c qd.dump.c \ -o qd.dump.standalone.o |
From: chas w. <ch...@us...> - 2004-02-26 01:26:06
|
Update of /cvsroot/linux-atm/linux-atm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23246 Modified Files: Tag: V2_5_0 ChangeLog autotools configure.in Removed Files: Tag: V2_5_0 acconfig.h config.h.in Log Message: updated configure bits so that later versions of autoconf work properly Index: ChangeLog =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/ChangeLog,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** ChangeLog 19 Jul 2003 21:20:43 -0000 1.2.2.3 --- ChangeLog 26 Feb 2004 01:10:37 -0000 1.2.2.4 *************** *** 14,21 **** --- 14,24 ---- - zeppelin creates /var/run/lec[itf].pid at startup - ilmid updates from ek...@cm... + - atmswitch from ele...@in... Other changes ------------- + - updated to support later versions of autoconf + Version 2.4.0 to 2.4.1 (25-APR-2003) Index: autotools =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/autotools,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** autotools 9 Oct 2001 22:33:01 -0000 1.2 --- autotools 26 Feb 2004 01:10:37 -0000 1.2.2.1 *************** *** 7,10 **** --- 7,12 ---- fi + echo "Running libtoolize..." + libtoolize --force echo "Running aclocal..." aclocal $VERBOSE Index: configure.in =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/configure.in,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -C2 -d -r1.2.2.4 -r1.2.2.5 *** configure.in 21 Feb 2004 15:31:40 -0000 1.2.2.4 --- configure.in 26 Feb 2004 01:10:37 -0000 1.2.2.5 *************** *** 60,64 **** dnl For yacc compiles... ! AC_DEFINE(YY_USE_CONST) dnl Config files --- 60,64 ---- dnl For yacc compiles... ! AC_DEFINE(YY_USE_CONST, [], [ ]) dnl Config files *************** *** 66,70 **** test "x$prefix" = xNONE && prefix=${exec_prefix} eval echo "$sysconfdir"` ! AC_DEFINE_UNQUOTED(ATMSIGD_CONF,"$atmsigd_conf_dir/atmsigd.conf") dnl Do our ./configure arguments here --- 66,70 ---- test "x$prefix" = xNONE && prefix=${exec_prefix} eval echo "$sysconfdir"` ! AC_DEFINE_UNQUOTED(ATMSIGD_CONF, "$atmsigd_conf_dir/atmsigd.conf", [Default config file location for atmsigd]) dnl Do our ./configure arguments here *************** *** 73,84 **** [ case "$with_uni" in ! "3.0" ) AC_DEFINE(UNI30) ;; ! "3.1" ) AC_DEFINE(UNI31) ;; ! "4.0" ) AC_DEFINE(UNI40) ;; *) ! AC_DEFINE(DYNAMIC_UNI) AC_MSG_WARN([*** UNI version not specified correctly. Defaulting to dynamic UNI.]) esac --- 73,87 ---- [ case "$with_uni" in ! "3.0" ) AC_DEFINE(UNI30, [], [ ]) ;; ! "3.1" ) AC_DEFINE(UNI31, [], [Note: some UNI 3.0 switches will show really strange behaviour if confronted ! with using 3.1 signaling, so be sure to test your network *very* ! carefully before permanently configuring machines to use UNI 3.1.]) ;; ! "4.0" ) AC_DEFINE(UNI40, [], [Some partial support for UNI 4.0 can be enabled by using UNI40]) ;; *) ! AC_DEFINE(DYNAMIC_UNI, [], [The UNI version can be configured at run time. Dynamic is the default. Use the ! explicit version selections only in case of problems.]) AC_MSG_WARN([*** UNI version not specified correctly. Defaulting to dynamic UNI.]) esac *************** *** 91,95 **** [ if test "$with_uni" = "3.1" ; then ! AC_DEFINE(ALLOW_UNI30) else AC_MSG_WARN([*** Allow UNI 3.0 was not enabled. It is only valid when UNI 3.1 is specified as the default via --with-uni.]) --- 94,98 ---- [ if test "$with_uni" = "3.1" ; then ! AC_DEFINE(ALLOW_UNI30, [], [Allow UNI 3.0 backwards-compatible extensions (if using UNI 3.1)]) else AC_MSG_WARN([*** Allow UNI 3.0 was not enabled. It is only valid when UNI 3.1 is specified as the default via --with-uni.]) *************** *** 102,106 **** [ if test "$with_uni" = "4.0" ; then ! AC_DEFINE(Q2963_1) else AC_MSG_WARN([*** Q.2963.1 was not enabled. It is only valid when UNI 4.0 is specified as the default via --with-uni.]) --- 105,110 ---- [ if test "$with_uni" = "4.0" ; then ! AC_DEFINE(Q2963_1, [], [If using UNI40, you can also enable peak cell rate modification as ! specified in Q.2963.1]) else AC_MSG_WARN([*** Q.2963.1 was not enabled. It is only valid when UNI 4.0 is specified as the default via --with-uni.]) *************** *** 111,129 **** AC_ARG_ENABLE(cisco, [ --enable-cisco Enable work around for point-to-multipoint signaling bug in Cisco LS100 or LS7010 switches], ! AC_DEFINE(CISCO) ) AC_ARG_ENABLE(thomflex, [ --enable-thomflex Some versions of the Thomson Thomflex 5000 won't do any signaling before they get a RESTART. Enable sending of a RESTART whenever SAAL comes up.], ! AC_DEFINE(THOMFLEX) ) dnl Use select() instead of poll() with MPOA dnl Do we still need this?? Make it selectable?? ! AC_DEFINE(BROKEN_POLL) AC_ARG_ENABLE(mpoa_1_1, [ --enable-mpoa_1_1 Enable proposed MPOA 1.1 features], ! AC_DEFINE(MPOA_1_1) ) --- 115,140 ---- AC_ARG_ENABLE(cisco, [ --enable-cisco Enable work around for point-to-multipoint signaling bug in Cisco LS100 or LS7010 switches], ! AC_DEFINE(CISCO, [], [If you're using a Cisco LS100 or LS7010 switch, you should add the following ! line to work around a bug in their point-to-multipoint signaling (it got ! confused when receiving a CALL PROCEEDING, so we don't send it, which of ! course makes our clearing procedure slightly non-conformant):]) ) AC_ARG_ENABLE(thomflex, [ --enable-thomflex Some versions of the Thomson Thomflex 5000 won't do any signaling before they get a RESTART. Enable sending of a RESTART whenever SAAL comes up.], ! AC_DEFINE(THOMFLEX, [], [Some versions of the Thomson Thomflex 5000 won't do any signaling before they ! get a RESTART. Uncomment the next line to enable sending of a RESTART ! whenever SAAL comes up. Note that the RESTART ACKNOWLEDGE sent in response to ! the RESTART will yield a warning, because we don't implement the full RESTART ! state machine.]) ) dnl Use select() instead of poll() with MPOA dnl Do we still need this?? Make it selectable?? ! AC_DEFINE(BROKEN_POLL, [], [Use select() instead of poll() with MPOA]) AC_ARG_ENABLE(mpoa_1_1, [ --enable-mpoa_1_1 Enable proposed MPOA 1.1 features], ! AC_DEFINE(MPOA_1_1, [], [Use proposed MPOA 1.1 features]) ) --- acconfig.h DELETED --- --- config.h.in DELETED --- |
From: chas w. <ch...@us...> - 2004-02-26 01:14:28
|
Update of /cvsroot/linux-atm/linux-atm/src/br2684 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20929/br2684 Modified Files: Tag: V2_5_0 br2684ctl.c Log Message: create pid file /var/run/nas%d when started Index: br2684ctl.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/br2684/Attic/br2684ctl.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** br2684ctl.c 19 Jul 2003 22:24:51 -0000 1.1.2.2 --- br2684ctl.c 26 Feb 2004 00:59:04 -0000 1.1.2.3 *************** *** 44,47 **** --- 44,63 ---- + int create_pidfile(int num) + { + FILE *pidfile = NULL; + char name[32]; + + if (num < 0) return -1; + + snprintf(name, 20, "/var/run/nas%d.pid", num); + pidfile = fopen(name, "w"); + if (pidfile == NULL) return -1; + fprintf(pidfile, "%d", getpid()); + fclose(pidfile); + + return 0; + } + int create_br(char *nstr) { *************** *** 159,162 **** --- 175,179 ---- int c, background=0, encap=0, sndbuf=8192; struct atm_qos reqqos; + int itfnum; lastsock=-1; lastitf=0; *************** *** 181,184 **** --- 198,202 ---- case 'c': create_br(optarg); + itfnum = atoi(optarg); break; case 'e': *************** *** 243,246 **** --- 261,266 ---- } + create_pidfile(itfnum); + syslog (LOG_INFO, "RFC 1483/2684 bridge daemon started\n"); atexit (exitFunc); |
From: chas w. <ch...@us...> - 2004-02-24 23:51:56
|
Update of /cvsroot/linux-atm/linux-atm/src/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26428 Modified Files: Tag: V2_5_0 Makefile.am Added Files: Tag: V2_5_0 atmswitch.c Log Message: added atmswitch from Eric Leblond <ele...@al...> --- NEW FILE: atmswitch.c --- /* ** Copyright (C) 2004 Init-Sys (http://www.init-sys.com) ** Written by Eric Leblond <ele...@al...> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, version 2 of the License. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if HAVE_CONFIG_H #include <config.h> #endif #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <atm.h> #define BUF_SIZE 10000 static fd_set pvc_set; static int fds; static int s[2]; static void usage(const char *name) { fprintf(stderr,"usage: %s [-b] [-q QOS] [itf.]vpi.vci [itf.]vpi.vci\n",name); exit(1); } int main(int argc,char **argv) { const char *name; const char *options_list = "bq:Vh"; struct sockaddr_atmpvc addr; struct atm_qos qos[2]; int background=0; int set_qos=0; int pvc; int option; name = argv[0]; memset(qos,0,2*sizeof(*qos)); /*parse options */ while((option = getopt ( argc, argv, options_list)) != -1 ){ switch (option){ case 'b' : background=1; break; case 'q' : /* reading qos */ if (text2qos(optarg,qos,0)<0){ fprintf (stderr, "Invalid QOS\n"); return 0; } if (text2qos(optarg,qos+1,0)<0){ fprintf (stderr, "Strange !\n"); } /* inert qos on receiver */ qos[1].rxtp=qos[0].txtp; qos[1].txtp=qos[0].rxtp; set_qos=1; break; case 'V' : fprintf (stdout, "atmswitch (version 0.2)\n"); return 1; break; case 'h' : usage(name); return 1; break; } } if ((argc - optind) != 2) { fprintf(stderr,"Invalid number of arguments\n"); usage(name); } if (background) { pid_t pid; pid=fork(); if (pid < 0) { fprintf(stderr,"Error detaching\n"); exit(2); } else if (pid) exit(0); // This is the parent } /* init pvc_set */ FD_ZERO(&pvc_set); fds=0; /* init pvc socket */ for (pvc=0;pvc<=1;pvc++){ if ((s[pvc] = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) { perror("socket"); return 1; } memset(&addr,0,sizeof(addr)); if ( set_qos == 0) { qos[pvc].aal = ATM_AAL5; qos[pvc].rxtp.traffic_class = ATM_UBR; qos[pvc].txtp.traffic_class = ATM_UBR; qos[pvc].txtp.pcr = ATM_MAX_PCR; qos[pvc].rxtp.pcr = ATM_MAX_PCR; qos[pvc].txtp.max_sdu = 1524; qos[pvc].rxtp.max_sdu = 1524; } if (text2atm(argv[optind+pvc],(struct sockaddr *) &addr,sizeof(addr), T2A_PVC | T2A_UNSPEC | T2A_WILDCARD) < 0) usage(name); if (setsockopt(s[pvc],SOL_ATM,SO_ATMQOS,qos+pvc,sizeof(qos[0])) < 0) { perror("setsockopt SO_ATMQOS"); return 1; } if (connect(s[pvc],(struct sockaddr *) &addr,sizeof(addr)) < 0) { perror("connect"); return 1; } /* add PVC socket fo fd_set */ FD_SET(s[pvc],&pvc_set); if (s[pvc] >= fds) fds = s[pvc]+1; } /* infinite loop */ while (1) { int ret; fd_set set; set=pvc_set; ret = select(fds,&set,NULL,NULL,NULL); if (ret < 0) { if (errno != EINTR) perror("select"); continue; } for (pvc=0;pvc<=1;pvc++){ if (FD_ISSET(s[pvc],&set)){ char buf[BUF_SIZE]; int bufsiz=0; /* read s[pvc] */ bufsiz=read(s[pvc],buf,BUF_SIZE); if (bufsiz > 0){ /* write s[(pvc+1)%2] */ write(s[(pvc+1)%2],buf,bufsiz); } else { perror("read"); } } } } } Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/test/Makefile.am,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** Makefile.am 2 May 2003 13:47:13 -0000 1.2.2.1 --- Makefile.am 24 Feb 2004 23:37:24 -0000 1.2.2.2 *************** *** 1,3 **** ! USRPGMS = aread awrite ttcp_atm PGMS = align aping br bw isp window bin_PROGRAMS = $(USRPGMS) --- 1,3 ---- ! USRPGMS = aread awrite ttcp_atm atmswitch PGMS = align aping br bw isp window bin_PROGRAMS = $(USRPGMS) *************** *** 6,9 **** --- 6,10 ---- LDADD = $(top_builddir)/src/lib/libatm.la + atmswitch_SOURCES = atmswitch.c aread_SOURCES = aread.c awrite_SOURCES = awrite.c |
From: chas w. <ch...@us...> - 2004-02-21 15:43:39
|
Update of /cvsroot/linux-atm/linux-atm/src/extra In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10452/src/extra Added Files: Tag: V2_5_0 oam.patch Log Message: import preliminary OAM support from Jorge Boncompte [DTI2] <jo...@dt...> --- NEW FILE: oam.patch --- # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1345 -> 1.1346 # net/atm/Makefile 1.6 -> 1.7 # net/Config.in 1.14 -> 1.15 # net/atm/raw.c 1.3 -> 1.4 # net/atm/common.c 1.29 -> 1.30 # (new) -> 1.1 include/linux/atmoam.h # (new) -> 1.1 net/atm/oam.c # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/21 ch...@re... 1.1346 # [ATM]: OAM support from Jorge Boncompte [DTI2] <jo...@dt...> # -------------------------------------------- # diff -Nru a/include/linux/atmoam.h b/include/linux/atmoam.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/include/linux/atmoam.h Sat Feb 21 09:13:01 2004 @@ -0,0 +1,77 @@ +/* + * atmoam.h - ATM OAM protocol and kernel-daemon interface definitions + * + * Written 2003 by Jorge Boncompte, DTI2 +*/ + +#ifndef _LINUX_ATMOAM_H +#define _LINUX_ATMOAM_H + +#ifdef __KERNEL__ +#include <linux/types.h> +#endif +#include <linux/atmapi.h> +#include <linux/atmioc.h> + +#define ATMOAMD_CTRL _IO('a', ATMIOC_SPECIAL+4) /* become atmoamd ctrl sock */ + +#define POLYNOMIAL 0x633 + +/* OAM Cell Types */ +#define ATM_OAM_T_FAULT 1 +#define ATM_OAM_T_PERF 2 +#define ATM_OAM_T_ACTDEACT 8 + +/* OAM Cell Functions */ +#define ATM_OAM_F_AIS 0 +#define ATM_OAM_F_FERF 1 +#define ATM_OAM_F_CONT 4 +#define ATM_OAM_F_LOOP 8 + +#define OAM_TYPE_SHIFT 4 +#define OAM_FUNC_MASK 0x0000000f + +#define OAM_TYPE(X) (X[0] >> OAM_TYPE_SHIFT) +#define OAM_FUNC(X) (X[0] & OAM_FUNC_MASK) +#define ATM_CELL_PTI(X) ((X & ATM_HDR_PTI_MASK) >> ATM_HDR_PTI_SHIFT) + +struct oamcell { + unsigned char hdr[ATM_AAL0_SDU - ATM_CELL_PAYLOAD]; /* AAL0 Cell Header */ + unsigned char payload[ATM_CELL_PAYLOAD]; +}; + +struct atmoam_ctrl { + atm_kptr_t vcc; /* Vcc Kernel Pointer */ + int number; /* Device index */ + short pti; /* Payload Type Identifier */ + short vpi; /* VPI number */ + int vci; /* VCI number */ + struct oamcell cell; +}; + +#ifdef __KERNEL__ +struct atm_oam_ops { + int (*toatmoamd)(struct atm_vcc *vcc, void *oamcell); + int (*init)(struct atm_vcc *vcc); + struct module *owner; +}; + +void atm_oam_ops_set(struct atm_oam_ops *); +int try_atm_oam_ops(void); + +extern struct atm_oam_ops *atm_oam_ops; +#endif + +struct oampayload { + u_int8_t FunctNType; + + u_int8_t LoopBackInd:8; + u_int8_t CorrelationTag[4]; + u_int8_t LocationID[16]; + u_int8_t SourceID[16]; + u_int8_t Unused[8]; + + u_int8_t OAMCRC10[2]; +}; + +#endif diff -Nru a/net/Config.in b/net/Config.in --- a/net/Config.in Sat Feb 21 09:13:01 2004 +++ b/net/Config.in Sat Feb 21 09:13:01 2004 @@ -50,6 +50,7 @@ if [ "$CONFIG_ATM_BR2684" != "n" ]; then bool ' Per-VC IP filter kludge' CONFIG_ATM_BR2684_IPFILTER fi + dep_tristate ' OAM protocol support' CONFIG_ATM_OAM $CONFIG_ATM fi fi tristate '802.1Q VLAN Support' CONFIG_VLAN_8021Q diff -Nru a/net/atm/Makefile b/net/atm/Makefile --- a/net/atm/Makefile Sat Feb 21 09:13:01 2004 +++ b/net/atm/Makefile Sat Feb 21 09:13:01 2004 @@ -46,6 +46,7 @@ obj-$(CONFIG_ATM_LANE) += lec.o obj-$(CONFIG_ATM_MPOA) += mpoa.o obj-$(CONFIG_PPPOATM) += pppoatm.o +obj-$(CONFIG_ATM_OAM) += oam.o include $(TOPDIR)/Rules.make diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Sat Feb 21 09:13:01 2004 +++ b/net/atm/common.c Sat Feb 21 09:13:01 2004 @@ -129,6 +129,36 @@ #endif #endif +#if defined(CONFIG_ATM_OAM) || defined(CONFIG_ATM_OAM_MODULE) +#include <linux/atmoam.h> +struct atm_oam_ops *atm_oam_ops; +static DECLARE_MUTEX(atm_oam_ops_mutex); + +void atm_oam_ops_set(struct atm_oam_ops *hook) +{ + down(&atm_oam_ops_mutex); + atm_oam_ops = hook; + up(&atm_oam_ops_mutex); +} + +int try_atm_oam_ops(void) +{ + down(&atm_oam_ops_mutex); + if (atm_oam_ops && try_inc_mod_count(atm_oam_ops->owner)) { + up(&atm_oam_ops_mutex); + return 1; + } + up(&atm_oam_ops_mutex); + return 0; +} + +#ifdef CONFIG_ATM_OAM_MODULE +EXPORT_SYMBOL(atm_oam_ops); +EXPORT_SYMBOL(try_atm_oam_ops); +EXPORT_SYMBOL(atm_oam_ops_set); +#endif +#endif + #if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) static DECLARE_MUTEX(pppoatm_ioctl_mutex); @@ -782,6 +812,26 @@ error = atm_clip_ops->clip_encap(vcc, arg); if (atm_clip_ops->owner) __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + } else + error = -ENOSYS; + goto done; +#endif +#if defined(CONFIG_ATM_OAM) || defined(CONFIG_ATM_OAM_MODULE) + case ATMOAMD_CTRL: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } +#if defined(CONFIG_ATM_OAM_MODULE) + if (!atm_oam_ops) + request_module("oam"); +#endif + if (try_atm_oam_ops()) { + error = atm_oam_ops->init(vcc); + if (atm_oam_ops->owner) + __MOD_DEC_USE_COUNT(atm_oam_ops->owner); + if (!error) + sock->state = SS_CONNECTED; } else error = -ENOSYS; goto done; diff -Nru a/net/atm/oam.c b/net/atm/oam.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/net/atm/oam.c Sat Feb 21 09:13:01 2004 @@ -0,0 +1,223 @@ +/* + * net/atm/oam.c - Kernel support for an userspace OAM daemon. + * + * Author: Jorge Boncompte, DTI-2 + * + * Based on the code of the linux ATM stack. + * + */ + +#include <linux/module.h> +#include <linux/errno.h> +#include <linux/sched.h> +#include <linux/kernel.h> +#include <linux/skbuff.h> +#include <linux/mm.h> +#include <linux/atm.h> +#include <linux/atmdev.h> +#include <linux/atmoam.h> + +#include "common.h" +#include "protocols.h" + +struct atm_vcc *atmoamd = NULL; + +#if 0 +#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args) +#else +#define DPRINTK(format,args...) +#endif + +static struct atm_vcc *vcc_find_byvpivci(struct atm_dev *dev, short vpi, int vci) +{ + struct sock *s; + struct atm_vcc *walk; + + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (test_bit(ATM_VF_ADDR, &walk->flags) && + walk->vpi == vpi && + walk->vci == vci) { + sock_hold(s); + read_unlock(&vcc_sklist_lock); + return walk; + } + } + + read_unlock(&vcc_sklist_lock); + return NULL; +} + +static int oam_to_atmoamd(struct atm_vcc *vcc, void *oamcell) +{ + struct atmoam_ctrl *oamctrl; + struct sk_buff *skb; + unsigned char *cell; + + DPRINTK("to_atmoamd\n"); + + cell = (unsigned char *) oamcell; + + if (!atmoamd) + return -EUNATCH; + + skb = alloc_skb(sizeof(struct atmoam_ctrl), GFP_ATOMIC); + + if (!skb) + return -ENOMEM; + + oamctrl = (struct atmoam_ctrl *) skb_put(skb, sizeof(struct atmoam_ctrl)); + + *(struct atm_vcc **) &oamctrl->vcc = vcc; + oamctrl->number = vcc->dev->number; + oamctrl->pti = ATM_CELL_PTI(cell[3]); + oamctrl->vpi = vcc->vpi; + oamctrl->vci = vcc->vci; + memcpy(&oamctrl->cell, cell, ATM_AAL0_SDU); + + DPRINTK("to_atmoamd: Intf %d PTI %d vc %d/%d Vcc 0x%p\n", + oamctrl->number, oamctrl->pti, oamctrl->vpi, oamctrl->vci, + *(struct atm_vcc **)&oamctrl->vcc); + +/* skb->stamp = xtime; + + if (!atm_charge(atmoamd, skb->truesize)) { + dev_kfree_skb_any(skb); + return -1; + } + ATM_SKB(skb)->vcc = atmoamd; +*/ + atm_force_charge(atmoamd, skb->truesize); + skb_queue_tail(&atmoamd->sk->receive_queue, skb); + wake_up(&atmoamd->sleep); + + return 0; +} + +static int oam_from_atmoamd(struct atm_vcc *oamvcc, struct sk_buff *skb) +{ + struct atm_vcc *vcc; + struct atm_dev *dev; + struct atmoam_ctrl *oamctrl = (struct atmoam_ctrl *) skb->data; + int result = 0; + + DPRINTK("from_atmoamd\n"); + + /* FIXME: Check message length? Is the below line correct? */ + atomic_sub(skb->truesize, &oamvcc->sk->wmem_alloc); + + DPRINTK("from_atmoamd: Intf %d PTI %d vc %d/%d Vcc 0x%p\n", + oamctrl->number, oamctrl->pti, oamctrl->vpi, oamctrl->vci, + *(struct atm_vcc **)&oamctrl->vcc); + + dev = atm_dev_lookup(oamctrl->number); + if (!dev) { + result = -ENODEV; + goto err; + } + + vcc = *(struct atm_vcc **) &oamctrl->vcc; + + /* This is a new outgoing cell, not a reply */ + if (vcc == 0) { + if ((vcc = vcc_find_byvpivci(dev, oamctrl->vpi, oamctrl->vci)) == NULL) { + DPRINTK("Vcc %d/%d not in device %d list\n", + oamctrl->vpi, oamctrl->vci, oamctrl->number); + result = -EUNATCH; + goto err_put; + } + } + + if (vcc->dev->ops->send_oam) + result = vcc->dev->ops->send_oam(vcc, &oamctrl->cell, 0); + else { + if (net_ratelimit()) + printk(KERN_INFO "%s%d: Driver does not support sending OAM cells\n", + dev->type, dev->number); + result = -ENOSYS; + } + sock_put(vcc->sk); + +err_put: + atm_dev_put(dev); +err: + if (result) /* Should we release the skb if there is no error? */ + kfree_skb(skb); + return result; +} + + +static void oam_close_atmoamd(struct atm_vcc *vcc) +{ + DPRINTK("atmoamd_close\n"); + atmoamd = NULL; /* assumed to be atomic */ + barrier(); + if (skb_peek(&vcc->sk->receive_queue)) + printk(KERN_ERR "atmoamd_close: closing with requests pending\n"); + skb_queue_purge(&vcc->sk->receive_queue); + DPRINTK("(done)\n"); + MOD_DEC_USE_COUNT; +} + + +static struct atmdev_ops atmoamd_dev_ops = { + .close = oam_close_atmoamd, + .send = oam_from_atmoamd, +}; + + +static struct atm_dev atmoamd_dev = { + .ops = &atmoamd_dev_ops, /* device operations */ + .type = "oamd", /* device type */ + .number = 989, /* dummy device number */ +}; + + +int atm_init_atmoam(struct atm_vcc *vcc) +{ + DPRINTK("atm_init_atmoam\n"); + + if (atmoamd) + return -EADDRINUSE; + + atmoamd = vcc; + set_bit(ATM_VF_META, &vcc->flags); + set_bit(ATM_VF_READY, &vcc->flags); + + /* allow replies and avoid getting closed if signaling dies */ + vcc->dev = &atmoamd_dev; + vcc_insert_socket(vcc->sk); + vcc->push = NULL; + vcc->pop = NULL; /* crash */ + vcc->push_oam = NULL; /* crash */ + + MOD_INC_USE_COUNT; + return 0; +} + +static struct atm_oam_ops __atm_oam_ops = { + .toatmoamd = oam_to_atmoamd, + .init = atm_init_atmoam, + .owner = THIS_MODULE +}; + +static int __init atm_oam_init(void) +{ + atm_oam_ops_set(&__atm_oam_ops); + printk(KERN_INFO "ATM: OAM kernel module support loaded.\n"); + return 0; +} + +static void __exit atm_oam_exit(void) +{ + atm_oam_ops_set(NULL); + printk(KERN_INFO "ATM: OAM kernel module support removed.\n"); +} + +module_init(atm_oam_init); +module_exit(atm_oam_exit); + +MODULE_AUTHOR("Jorge Boncompte - DTI2"); +MODULE_DESCRIPTION("OAM support for ATM"); +MODULE_LICENSE("GPL"); diff -Nru a/net/atm/raw.c b/net/atm/raw.c --- a/net/atm/raw.c Sat Feb 21 09:13:01 2004 +++ b/net/atm/raw.c Sat Feb 21 09:13:01 2004 @@ -10,6 +10,9 @@ #include <linux/skbuff.h> #include <linux/mm.h> +#if defined(CONFIG_ATM_OAM) || defined(CONFIG_ATM_OAM_MODULE) +#include <linux/atmoam.h> +#endif #include "common.h" #include "protocols.h" @@ -21,6 +24,24 @@ #endif +int atm_push_oam(struct atm_vcc *vcc, void *oamcell) +{ + int result = 0; + + DPRINTK("atm_push_oam\n"); + +#if defined(CONFIG_ATM_OAM) || defined(CONFIG_ATM_OAM_MODULE) + if (try_atm_oam_ops()) { + result = atm_oam_ops->toatmoamd(vcc, (unsigned char *) oamcell); + if (atm_oam_ops->owner) + __MOD_DEC_USE_COUNT(atm_oam_ops->owner); + } else + result = -ENOSYS; +#endif + return result; +} + + /* * SKB == NULL indicates that the link is being closed */ @@ -84,7 +105,7 @@ { vcc->push = atm_push_raw; vcc->pop = atm_pop_raw; - vcc->push_oam = NULL; + vcc->push_oam = atm_push_oam; vcc->send = vcc->dev->ops->send; return 0; } |
From: chas w. <ch...@us...> - 2004-02-21 15:43:39
|
Update of /cvsroot/linux-atm/linux-atm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10452 Modified Files: Tag: V2_5_0 configure.in Log Message: import preliminary OAM support from Jorge Boncompte [DTI2] <jo...@dt...> Index: configure.in =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/configure.in,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** configure.in 19 Jul 2003 22:03:27 -0000 1.2.2.3 --- configure.in 21 Feb 2004 15:31:40 -0000 1.2.2.4 *************** *** 167,170 **** --- 167,171 ---- src/lane/Makefile \ src/mpoad/Makefile \ + src/oamd/Makefile \ src/switch/Makefile \ src/switch/debug/Makefile \ |
From: chas w. <ch...@us...> - 2004-02-21 15:43:39
|
Update of /cvsroot/linux-atm/linux-atm/src/oamd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10452/src/oamd Added Files: Tag: V2_5_0 Makefile.am atmoamd.c crc10.c crc10.h io.c io.h oam.c oam.h Log Message: import preliminary OAM support from Jorge Boncompte [DTI2] <jo...@dt...> --- NEW FILE: Makefile.am --- sbin_PROGRAMS = atmoamd atmoamd_SOURCES = atmoamd.c io.c io.h oam.c oam.h crc10.c crc10.h atmoamd_LDADD = $(top_builddir)/src/lib/libatm.la atmoamd_DEPENDENCIES = $(zeppelin_LDADD) --- NEW FILE: atmoamd.c --- #if HAVE_CONFIG_H #include <config.h> #endif #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> #include <signal.h> #include <atm.h> #include "io.h" #define COMPONENT "OAMD" int timer, run_fsm, debug; static void usage(const char *name) { fprintf(stderr, "usage: %s [-b] [-d]\n", name); fprintf(stderr, "%6s %s -V\n", "", name); exit(1); } static void sig_handler(int signo) { if (signo == SIGALRM) { timer++; run_fsm = 1; signal(SIGALRM, sig_handler); alarm(1); } } int main(int argc, char **argv) { int c, background = 0; set_application("atmoamd"); set_verbosity(NULL,DIAG_INFO); while ((c = getopt(argc,argv,"bdV")) != EOF) switch (c) { case 'b': background = 1; break; case 'd': set_verbosity(NULL,DIAG_DEBUG); debug = 1; break; case 'V': printf("%s\n",VERSION); return 0; default: usage(argv[0]); } if (argc != optind) usage(argv[0]); diag(COMPONENT,DIAG_INFO,"Linux ATM OAM, version " VERSION); open_kernel(); /* run in background */ if (background) { pid_t pid; pid = fork(); if (pid < 0) diag(COMPONENT,DIAG_FATAL,"fork: %s",strerror(errno)); if (pid) { diag(COMPONENT,DIAG_DEBUG,"Backgrounding (PID %d)",pid); exit(0); } } signal(SIGALRM, sig_handler); alarm(1); poll_loop(); close_kernel(); return 0; } --- NEW FILE: crc10.c --- #include <atm.h> #include "crc10.h" static unsigned short byte_crc10_table[256] = { 0x0000, 0x0233, 0x0255, 0x0066, 0x0299, 0x00aa, 0x00cc, 0x02ff, 0x0301, 0x0132, 0x0154, 0x0367, 0x0198, 0x03ab, 0x03cd, 0x01fe, 0x0031, 0x0202, 0x0264, 0x0057, 0x02a8, 0x009b, 0x00fd, 0x02ce, 0x0330, 0x0103, 0x0165, 0x0356, 0x01a9, 0x039a, 0x03fc, 0x01cf, 0x0062, 0x0251, 0x0237, 0x0004, 0x02fb, 0x00c8, 0x00ae, 0x029d, 0x0363, 0x0150, 0x0136, 0x0305, 0x01fa, 0x03c9, 0x03af, 0x019c, 0x0053, 0x0260, 0x0206, 0x0035, 0x02ca, 0x00f9, 0x009f, 0x02ac, 0x0352, 0x0161, 0x0107, 0x0334, 0x01cb, 0x03f8, 0x039e, 0x01ad, 0x00c4, 0x02f7, 0x0291, 0x00a2, 0x025d, 0x006e, 0x0008, 0x023b, 0x03c5, 0x01f6, 0x0190, 0x03a3, 0x015c, 0x036f, 0x0309, 0x013a, 0x00f5, 0x02c6, 0x02a0, 0x0093, 0x026c, 0x005f, 0x0039, 0x020a, 0x03f4, 0x01c7, 0x01a1, 0x0392, 0x016d, 0x035e, 0x0338, 0x010b, 0x00a6, 0x0295, 0x02f3, 0x00c0, 0x023f, 0x000c, 0x006a, 0x0259, 0x03a7, 0x0194, 0x01f2, 0x03c1, 0x013e, 0x030d, 0x036b, 0x0158, 0x0097, 0x02a4, 0x02c2, 0x00f1, 0x020e, 0x003d, 0x005b, 0x0268, 0x0396, 0x01a5, 0x01c3, 0x03f0, 0x010f, 0x033c, 0x035a, 0x0169, 0x0188, 0x03bb, 0x03dd, 0x01ee, 0x0311, 0x0122, 0x0144, 0x0377, 0x0289, 0x00ba, 0x00dc, 0x02ef, 0x0010, 0x0223, 0x0245, 0x0076, 0x01b9, 0x038a, 0x03ec, 0x01df, 0x0320, 0x0113, 0x0175, 0x0346, 0x02b8, 0x008b, 0x00ed, 0x02de, 0x0021, 0x0212, 0x0274, 0x0047, 0x01ea, 0x03d9, 0x03bf, 0x018c, 0x0373, 0x0140, 0x0126, 0x0315, 0x02eb, 0x00d8, 0x00be, 0x028d, 0x0072, 0x0241, 0x0227, 0x0014, 0x01db, 0x03e8, 0x038e, 0x01bd, 0x0342, 0x0171, 0x0117, 0x0324, 0x02da, 0x00e9, 0x008f, 0x02bc, 0x0043, 0x0270, 0x0216, 0x0025, 0x014c, 0x037f, 0x0319, 0x012a, 0x03d5, 0x01e6, 0x0180, 0x03b3, 0x024d, 0x007e, 0x0018, 0x022b, 0x00d4, 0x02e7, 0x0281, 0x00b2, 0x017d, 0x034e, 0x0328, 0x011b, 0x03e4, 0x01d7, 0x01b1, 0x0382, 0x027c, 0x004f, 0x0029, 0x021a, 0x00e5, 0x02d6, 0x02b0, 0x0083, 0x012e, 0x031d, 0x037b, 0x0148, 0x03b7, 0x0184, 0x01e2, 0x03d1, 0x022f, 0x001c, 0x007a, 0x0249, 0x00b6, 0x0285, 0x02e3, 0x00d0, 0x011f, 0x032c, 0x034a, 0x0179, 0x0386, 0x01b5, 0x01d3, 0x03e0, 0x021e, 0x002d, 0x004b, 0x0278, 0x0087, 0x02b4, 0x02d2, 0x00e1, }; unsigned short update_crc10_by_bytes(unsigned short crc10_accum, unsigned char *data_blk_ptr, int data_blk_size) { register int i; for (i = 0; i < data_blk_size; i++) { crc10_accum = ((crc10_accum << 8) & 0x3ff) ^ byte_crc10_table[(crc10_accum >> 2) & 0xff] ^ *data_blk_ptr++; } return crc10_accum; } unsigned short crc10(unsigned char *payload) { unsigned short crc; payload[46] = payload[47] = 0; crc = update_crc10_by_bytes(0, payload, ATM_CELL_PAYLOAD); payload[46] ^= crc >> 8; payload[47] ^= crc & 0xff; return crc; } int crc10_check(unsigned char *payload) { unsigned short old_crc, crc; old_crc = payload[47]; old_crc += payload[46] << 8; crc = crc10(payload); if (crc != old_crc) return -1; /* Failed CRC10 check */ else return 0; /* CRC10 correct */ } --- NEW FILE: crc10.h --- /* * crc10.h CRC10 * * Written 2003 by Jorge Boncompte, DTI2 * * The CRC10 table and sum routine are from the f4loopbackd.c source */ #ifndef CRC10_H #define CRC10_H #define POLYNOMIAL 0x633 unsigned short crc10(unsigned char *payload); int crc10_check(unsigned char *payload); #endif --- NEW FILE: io.c --- /* io.c - I/O operations */ /* Written 1995-2000 by Werner Almesberger, EPFL-LRC/ICA */ #if HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include <stdint.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <sys/time.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <sys/poll.h> #include <net/if.h> #include <netinet/in.h> #include <atm.h> #define _LINUX_NETDEVICE_H /* glibc2 */ #include <linux/if_arp.h> #include "atmd.h" #include "io.h" #include "oam.h" #define COMPONENT "IO" static int kernel; extern int run_fsm; /* ----- kernel interface -------------------------------------------------- */ void open_kernel(void) { if ((kernel = socket(PF_ATMSVC, SOCK_DGRAM, 0)) < 0) diag(COMPONENT, DIAG_FATAL, "socket: %s", strerror(errno)); if (ioctl(kernel, ATMOAMD_CTRL, 0) < 0) diag(COMPONENT, DIAG_FATAL, "ioctl ATMOAMD_CTRL: %s", strerror(errno)); } int send_kernel(struct atmoam_ctrl *ctrl) { int size; size = write(kernel, ctrl, sizeof (struct atmoam_ctrl)); if (size < 0) { diag(COMPONENT, DIAG_DEBUG, "write kernel: %s", strerror(errno)); return -errno; } return size; } void recv_kernel(void) { struct atmoam_ctrl ctrl; int size; size = read(kernel, &ctrl, sizeof (ctrl)); if (size < 0) { diag(COMPONENT, DIAG_ERROR, "read kernel: %s", strerror(errno)); return; } diag(COMPONENT, DIAG_DEBUG, "OAM %s Cell received on Intf %d VPI/VCI %d/%d (Vcc %p)", ctrl.pti == 5 ? "F5-E2E" : (ctrl.pti == 4 ? "F5-SEG" : "UNK"), ctrl.number, ctrl.vpi, ctrl.vci, *(struct atm_vcc **) &ctrl.vcc); oam_process(&ctrl); } void close_kernel(void) { close(kernel); } void poll_loop(void) { struct pollfd pollfds; pollfds.fd = kernel; pollfds.events = POLLIN; /* Que eventos queremos, solo entradas */ for (;;) { oam_state_print(); if (run_fsm) { oam_fsm(); run_fsm = 0; } switch (poll(&pollfds, 1, 10000)) { case 0: break; case -1: if (errno != EINTR) diag(COMPONENT, DIAG_ERROR, "poll loop...%s", strerror(errno)); break; default: if (pollfds.revents && POLLIN) recv_kernel(); } } } --- NEW FILE: io.h --- /* io.h - I/O operations */ /* Written 1995-1999 by Werner Almesberger, EPFL-LRC/ICA */ #ifndef IO_H #define IO_H #include <stdint.h> #include <sys/socket.h> /* for struct sockaddr */ #include <atm.h> /* for struct sockaddr_atmsvc */ #include <atmd.h> #include <linux/atmoam.h> void open_kernel(void); void recv_kernel(void); int send_kernel(struct atmoam_ctrl *); void close_kernel(void); void poll_loop(void); #endif --- NEW FILE: oam.c --- #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <errno.h> #include <atm.h> #include <linux/atmoam.h> #include "oam.h" #include "io.h" #include "crc10.h" #define COMPONENT "OAM" extern int timer; struct oamfsm fsm; struct oamvcc vcc; void handle_circuit_state(int state) { vcc.state = state; diag(COMPONENT, DIAG_DEBUG, "VCC STATE CHANGE: %s", vcc.state ? "DOWN" : "UP"); if (vcc.state == VCC_UP) { system("backuprdsi stop&"); } else if (vcc.state == VCC_DOWN) { system("backuprdsi start&"); } } void oam_state_print(void) { return; printf ("-------------------------------------------------------------------\n"); printf("T: %d UP: %d DOWN: %d STATE: %d VCCSTATE %d CTag: %lx\n", timer, fsm.upretry, fsm.downretry, fsm.state, vcc.state, vcc.CTag); printf("InOAM: %lu OutOAM: %lu CrcErrors: %lu CTagErrors: %lu\n", vcc.stats.InOAM, vcc.stats.OutOAM, vcc.stats.CrcErrors, vcc.stats.CTagErrors); printf("InEndLoop: %lu OutEndLoop: %lu\n", vcc.stats.F5.InEndLoop, vcc.stats.F5.OutEndLoop); printf ("-------------------------------------------------------------------\n"); } static int put_ctag(unsigned char *pdu, unsigned long ctag) { if (pdu == NULL) return -1; pdu[2] = (unsigned char) (ctag >> 24); pdu[3] = (unsigned char) (ctag >> 16); pdu[4] = (unsigned char) (ctag >> 8); pdu[5] = (unsigned char) ctag; return 0; } static unsigned long get_ctag(unsigned char *pdu) { unsigned long ctag; if (pdu == NULL) return -1; ctag = (unsigned long) pdu[5]; ctag += (unsigned long) (pdu[4] << 8); ctag += (unsigned long) (pdu[3] << 16); ctag += (unsigned long) (pdu[2] << 24); return ctag; } void oam_send(struct atmoam_ctrl *ctrl) { int error; error = send_kernel(ctrl); if (error > 0) { fsm.state = OAM_SENT; vcc.stats.OutOAM++; vcc.stats.F5.OutEndLoop++; } else if (error == -EUNATCH) { OAM_WAIT_10_S; vcc.stats.OutDrops++; } } static unsigned long oam_build_lb_cell(struct atmoam_ctrl *ctrl) { unsigned char *oamcell = (unsigned char *) &ctrl->cell; static unsigned long tag = 0; const unsigned char lpBackLocId[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; const unsigned char srcId[] = { 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A, 0x6A }; unsigned char *pdu = oamcell + 4; unsigned char *hdr = oamcell; unsigned short crc; // fill vpi hdr[0] = ctrl->vpi >> 4; hdr[1] = (ctrl->vpi & 0x0F) << 4; // fill vci hdr[1] |= ctrl->vci >> 12; hdr[2] = (ctrl->vci >> 4) & 0xFF; hdr[3] = 0x0A; hdr[3] |= (ctrl->vci & 0x0F) << 4; // updates the HEC // loopback function pdu[0] = 0x18; pdu[1] = 0x01; put_ctag(pdu, tag); tag++; // fill the loopback id memcpy(pdu + 6, lpBackLocId, 16); // fill the Src Id memcpy(pdu + 22, (unsigned char *) srcId, 16); // fill the unused bytes memcpy(pdu + 38, (unsigned char *) srcId, 8); // computes the CRC pdu[ATM_CELL_PAYLOAD - 2] = 0; pdu[ATM_CELL_PAYLOAD - 1] = 0; crc = crc10(pdu); pdu[ATM_CELL_PAYLOAD - 1] = (unsigned char) crc; pdu[ATM_CELL_PAYLOAD - 2] = (unsigned char) (crc >> 8); return tag - 1; } static int oam_fault(unsigned char *pdu) { struct oampayload *oampayload = (struct oampayload *) pdu; unsigned long ctag; if (OAM_FUNC(pdu) == ATM_OAM_F_LOOP) { ctag = get_ctag(pdu); diag(COMPONENT, DIAG_DEBUG, "\tReceived Fault-Mgmnt (%s) cell, CTag: 0x%lX", oampayload->LoopBackInd == 1 ? "Loopback" : "Loopback reply", ctag); if (pdu[1] == 1) { /* Celda de Loopback */ vcc.stats.F5.InEndLoop++; pdu[1] = 0; /* Clear Loopback but */ /* Recalculate CRC10 */ crc10(pdu); /* Volvemos a enviar la celda */ return 1; } if (pdu[1] == 0) { /* Loopback reply */ if (ctag == vcc.CTag) { vcc.stats.F5.InEndLoop++; OAM_INC_UPRETRY; if (fsm.upretry >= OAM_UPRETRY) { if (vcc.state == VCC_DOWN) handle_circuit_state(VCC_UP); } else { if (vcc.state == VCC_DOWN) { vcc.CTag = oam_build_lb_cell(&vcc. ctrl); oam_send(&vcc.ctrl); return 0; } } /* Desde aqui deberiamos ir a ESPERAR a 10 */ OAM_WAIT_10_S; return 0; } else { printf("Wrong Correlation Tag\n"); vcc.stats.CTagErrors++; OAM_INC_DOWNRETRY; if (fsm.downretry >= OAM_DOWNRETRY) { if (vcc.state == VCC_UP) handle_circuit_state(VCC_DOWN); } else { if (vcc.state == VCC_UP) { vcc.CTag = oam_build_lb_cell(&vcc. ctrl); oam_send(&vcc.ctrl); return 0; } } /* Desde aqui deberiamos ir a ESPERAR a 10 */ OAM_WAIT_10_S; return 0; } } } return 0; } void oam_process(struct atmoam_ctrl *ctrl) { vcc.stats.InOAM++; if (crc10_check(ctrl->cell.payload) != 0) { diag(COMPONENT, DIAG_ERROR, "Received OAM cell, failed CRC-10 check"); vcc.stats.CrcErrors++; OAM_INC_DOWNRETRY; if (fsm.downretry >= OAM_DOWNRETRY) { if (vcc.state == VCC_UP) handle_circuit_state(VCC_DOWN); } else { if (vcc.state == VCC_UP) { vcc.CTag = oam_build_lb_cell(&vcc.ctrl); oam_send(&vcc.ctrl); return; } } /* Desde aqui deberiamos ir a ESPERAR a 10 */ OAM_WAIT_10_S; return; } switch (OAM_TYPE(ctrl->cell.payload)) { case ATM_OAM_T_FAULT: if (oam_fault(ctrl->cell.payload)) send_kernel(ctrl); break; case ATM_OAM_T_PERF: break; case ATM_OAM_T_ACTDEACT: break; } } void oam_fsm(void) { switch (fsm.state) { case OAM_INIT: timer = 0; vcc.ctrl.number = 0; vcc.ctrl.vpi = 8; vcc.ctrl.vci = 32; vcc.ctrl.pti = 5; vcc.CTag = oam_build_lb_cell(&vcc.ctrl); oam_send(&vcc.ctrl); break; case OAM_SENT: OAM_INC_DOWNRETRY; if (fsm.downretry >= OAM_DOWNRETRY) { if (vcc.state == VCC_UP) handle_circuit_state(VCC_DOWN); } else { if (vcc.state == VCC_UP) { vcc.CTag = oam_build_lb_cell(&vcc.ctrl); oam_send(&vcc.ctrl); return; } } /* Desde aqui deberiamos ir a ESPERAR a 10 */ OAM_WAIT_10_S; break; case OAM_WAIT10: if (timer != 10) return; else { fsm.state = OAM_INIT; return; } } } --- NEW FILE: oam.h --- /* * oam.h - OAM cell processing * * Written 2003 by Jorge Boncompte, DTI2 * */ #ifndef OAM_H #define OAM_H #define OAM_UPRETRY 3 #define OAM_DOWNRETRY 5 #define OAM_WAITRETRY 1 #define OAM_INIT 0 #define OAM_SENT 2 #define OAM_REPLY 3 #define OAM_WAIT10 4 #define VCC_UP 0 #define VCC_DOWN 1 #define OAM_INC_UPRETRY fsm.upretry++; fsm.downretry=0 #define OAM_INC_DOWNRETRY fsm.downretry++; fsm.upretry=0 #define OAM_WAIT_10_S timer = 0; fsm.state = OAM_WAIT10 struct oamfsm { int state; short upretry; short downretry; }; struct oamvcc { struct atmoam_ctrl ctrl; int state; unsigned long CTag; struct { unsigned long InOAM; unsigned long OutOAM; unsigned long CrcErrors; unsigned long CTagErrors; unsigned long OutDrops; struct { unsigned long InEndLoop; unsigned long InSegLoop; // unsigned long InAIS; // unsigned long InRDI; unsigned long OutEndLoop; unsigned long OutSegLoop; // unsigned long OutRDI; } F5; } stats; }; void oam_process(struct atmoam_ctrl *ctrl); void oam_fsm(void); void oam_state_print(void); #endif |
From: chas w. <ch...@us...> - 2004-02-21 15:40:40
|
Update of /cvsroot/linux-atm/linux-atm/src/oamd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9984/oamd Log Message: Directory /cvsroot/linux-atm/linux-atm/src/oamd added to the repository --> Using per-directory sticky tag `V2_5_0' |
From: chas w. <ch...@us...> - 2003-07-19 22:42:05
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1:/tmp/cvs-serv18685 Modified Files: Tag: V2_5_0 address.c conn.c display.c frames.c join.c kernel.c main.c Log Message: remove extra \n's from diag() Index: address.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/address.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** address.c 9 Oct 2001 22:33:07 -0000 1.2 --- address.c 19 Jul 2003 22:42:01 -0000 1.2.2.1 *************** *** 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.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** conn.c 16 Jul 2003 01:24:47 -0000 1.2.2.2 --- conn.c 19 Jul 2003 22:42:01 -0000 1.2.2.3 *************** *** 118,122 **** 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)); *************** *** 137,141 **** 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; } *************** *** 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'\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); } *************** *** 194,210 **** 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; *************** *** 216,220 **** 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; *************** *** 239,243 **** char buff[MAX_ATM_ADDR_LEN+1]; ! diag(COMPONENT, DIAG_DEBUG, "Outgoing call setup\n"); dst_addr->sas_family = AF_ATMSVC; --- 239,243 ---- char buff[MAX_ATM_ADDR_LEN+1]; ! diag(COMPONENT, DIAG_DEBUG, "Outgoing call setup"); dst_addr->sas_family = AF_ATMSVC; *************** *** 246,265 **** 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"); } *************** *** 274,281 **** 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; *************** *** 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\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; *************** *** 291,295 **** 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); *************** *** 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\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; } *************** *** 352,356 **** 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; *************** *** 370,374 **** Conn_t *conn; ! diag(COMPONENT, DIAG_DEBUG, "conn_create_listensocket\n"); fd = get_socket(listen_addr, sap, qos); --- 370,374 ---- Conn_t *conn; ! diag(COMPONENT, DIAG_DEBUG, "conn_create_listensocket"); fd = get_socket(listen_addr, sap, qos); *************** *** 377,381 **** ret = listen(fd, 16); if (ret != 0) { ! diag(COMPONENT, DIAG_DEBUG, "Listen failed: %s\n", strerror(errno)); close(fd); return NULL; --- 377,381 ---- ret = listen(fd, 16); if (ret != 0) { ! diag(COMPONENT, DIAG_DEBUG, "Listen failed: %s", strerror(errno)); close(fd); return NULL; *************** *** 384,388 **** 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; *************** *** 391,395 **** 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], *************** *** 410,419 **** 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; } *************** *** 441,445 **** 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; --- 441,445 ---- for(conn = connlist; conn; conn = next) { ! diag(COMPONENT, DIAG_DEBUG, "Destroying:%p fd:%d type:%d", conn, conn->fd, conn->type); next = conn->next; *************** *** 463,467 **** Conn_t *mcast; ! diag(COMPONENT, DIAG_DEBUG, "close_connection %p\n", conn); if (conn == lec_params.kernel || --- 463,467 ---- Conn_t *mcast; ! diag(COMPONENT, DIAG_DEBUG, "close_connection %p", conn); if (conn == lec_params.kernel || *************** *** 501,513 **** 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 ((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\n"); ioc.receive = 1; existing = NULL; --- 501,513 ---- 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; *************** *** 516,527 **** 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; } if (existing && existing->status == CONNECTED) { ! diag(COMPONENT, DIAG_DEBUG, "Closing old data direct, fd %d\n", existing->fd); close_connection(existing); } --- 516,527 ---- 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); } *************** *** 542,550 **** 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)); } --- 542,550 ---- 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)); } *************** *** 581,585 **** break; default: ! diag(COMPONENT, DIAG_ERROR, "check_connections: bad_type '%s'\n", get_type_string(conn->type)); break; --- 581,585 ---- break; default: ! diag(COMPONENT, DIAG_ERROR, "check_connections: bad_type '%s'", get_type_string(conn->type)); break; *************** *** 602,606 **** 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 --- 602,606 ---- 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 *************** *** 610,614 **** 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); --- 610,614 ---- 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); *************** *** 619,623 **** 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 (conn_already_exists(conn->atm_address, conn) && /* is calling address > called address */ --- 619,623 ---- 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 */ *************** *** 628,632 **** } if (ioctl(conn->fd, ATMLEC_DATA, &ioc) < 0) { ! diag(COMPONENT, DIAG_ERROR, "VCC attach failed: ioctl: %s\n", strerror(errno)); return -1; } --- 628,632 ---- } if (ioctl(conn->fd, ATMLEC_DATA, &ioc) < 0) { ! diag(COMPONENT, DIAG_ERROR, "VCC attach failed: ioctl: %s", strerror(errno)); return -1; } *************** *** 674,682 **** 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); --- 674,682 ---- 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); *************** *** 684,688 **** ret = write(conn->fd, frame, length); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "send_frame: write: %s\n", strerror(errno)); return -1; } --- 684,688 ---- ret = write(conn->fd, frame, length); if (ret < 0) { ! diag(COMPONENT, DIAG_ERROR, "send_frame: write: %s", strerror(errno)); return -1; } *************** *** 698,710 **** 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; --- 698,710 ---- 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; *************** *** 732,736 **** 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); --- 732,736 ---- 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); *************** *** 784,788 **** conn = list_add_conn(NULL); if (conn == NULL) { ! diag(COMPONENT, DIAG_ERROR, "conn_set_kernel_socket: list_add_conn failed\n"); return -1; } --- 784,788 ---- conn = list_add_conn(NULL); if (conn == NULL) { ! diag(COMPONENT, DIAG_ERROR, "conn_set_kernel_socket: list_add_conn failed"); return -1; } *************** *** 816,820 **** connlist->previous = conn; connlist = conn; ! diag(COMPONENT, DIAG_DEBUG, "Added conn:%p\n", conn); return conn; --- 816,820 ---- connlist->previous = conn; connlist = conn; ! diag(COMPONENT, DIAG_DEBUG, "Added conn:%p", conn); return conn; *************** *** 845,849 **** if (conn->next) conn->next->previous = conn->previous; ! diag(COMPONENT, DIAG_DEBUG, "Connlist: %p\n", connlist); conn->next=conn->previous= NULL; --- 845,849 ---- 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.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** display.c 9 Oct 2001 22:33:07 -0000 1.2 --- display.c 19 Jul 2003 22:42:01 -0000 1.2.2.1 *************** *** 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.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** frames.c 2 May 2003 16:39:36 -0000 1.2.2.1 --- frames.c 19 Jul 2003 22:42:01 -0000 1.2.2.2 *************** *** 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; } *************** *** 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; } *************** *** 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; } *************** *** 300,304 **** /* 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\n", conn->fd); memset(&msg, 0, sizeof(struct atmlec_msg)); msg.type = l_flush_tran_id; --- 300,304 ---- /* 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; *************** *** 357,361 **** 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; *************** *** 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\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; *************** *** 437,441 **** 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) *************** *** 476,480 **** 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: *************** *** 516,520 **** 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: *************** *** 554,558 **** 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: *************** *** 569,573 **** 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; *************** *** 581,585 **** 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.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** join.c 9 Oct 2001 22:33:07 -0000 1.2 --- join.c 19 Jul 2003 22:42:01 -0000 1.2.2.1 *************** *** 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 */ *************** *** 133,137 **** 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) { --- 133,137 ---- if (lecs_method == LECS_MANUAL) { ! 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", strerror(errno)); return -1; } ! diag(COMPONENT, DIAG_DEBUG, "About to wait for BUS to connect"); tv.tv_sec = lec_params.c7_ctrl_timeout; tv.tv_usec = 0; *************** *** 657,665 **** retval = select(n, &rfds, NULL, NULL, &tv); if (retval == 0) { ! diag(COMPONENT, DIAG_ERROR, "BUS connect to Multicast Forward listen socket timed out\n"); return -1; } if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "while waiting for Multicast Forward VCC: select: %s\n", strerror(errno)); return -1; --- 657,665 ---- retval = select(n, &rfds, NULL, NULL, &tv); if (retval == 0) { ! diag(COMPONENT, DIAG_ERROR, "BUS connect to Multicast Forward listen socket timed out"); return -1; } if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "while waiting for Multicast Forward VCC: select: %s", strerror(errno)); return -1; *************** *** 667,671 **** mcast_fwd = accept_conn(lec_params.mcast_listen); if (mcast_fwd == NULL) { ! diag(COMPONENT, DIAG_ERROR, "BUS connect to Multicast Forward listen socket failed\n"); return -1; } --- 667,671 ---- mcast_fwd = accept_conn(lec_params.mcast_listen); if (mcast_fwd == NULL) { ! diag(COMPONENT, DIAG_ERROR, "BUS connect to Multicast Forward listen socket failed"); return -1; } *************** *** 674,680 **** ioc_data.dev_num = lec_params.itf_num; ioc_data.receive = 2; /* Multicast distribute */ ! diag(COMPONENT, DIAG_DEBUG, "About to notify kernel about Multicast Forward VCC\n"); if (ioctl(mcast_fwd->fd, ATMLEC_DATA, &ioc_data) < 0) { ! diag(COMPONENT, DIAG_DEBUG, "Could not notify kernel: %s\n", strerror(errno)); return -1; } --- 674,680 ---- ioc_data.dev_num = lec_params.itf_num; ioc_data.receive = 2; /* Multicast distribute */ ! diag(COMPONENT, DIAG_DEBUG, "About to notify kernel about Multicast Forward VCC"); if (ioctl(mcast_fwd->fd, ATMLEC_DATA, &ioc_data) < 0) { ! diag(COMPONENT, DIAG_DEBUG, "Could not notify kernel: %s", strerror(errno)); return -1; } *************** *** 716,724 **** } if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_bus_addr: select: %s\n", strerror(errno)); return -1; } if (FD_ISSET(lec_params.ctrl_direct->fd, &rfds)) { ! diag(COMPONENT, DIAG_DEBUG, "get_bus_addr: ctrl.direct changed:\n"); retval = read_bus_arp(lec_params.ctrl_direct, addr, buff, sizeof(buff)); if (retval < 0) return -1; --- 716,724 ---- } if (retval < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_bus_addr: select: %s", strerror(errno)); return -1; } if (FD_ISSET(lec_params.ctrl_direct->fd, &rfds)) { ! diag(COMPONENT, DIAG_DEBUG, "get_bus_addr: ctrl.direct changed:"); retval = read_bus_arp(lec_params.ctrl_direct, addr, buff, sizeof(buff)); if (retval < 0) return -1; *************** *** 726,738 **** } if (lec_params.ctrl_dist != NULL && FD_ISSET(lec_params.ctrl_dist->fd, &rfds)) { ! diag(COMPONENT, DIAG_DEBUG, "get_bus_addr: ctrl.dist changed:\n"); retval = read_bus_arp(lec_params.ctrl_dist, addr, buff, sizeof(buff)); if (retval < 0) return -1; if (retval > 0) return retval; } ! diag(COMPONENT, DIAG_DEBUG, "get_bus_addr: consumed a packet\n"); } ! diag(COMPONENT, DIAG_ERROR, "Timeout while waiting for BUS LE_ARP response\n"); return 0; } --- 726,738 ---- } if (lec_params.ctrl_dist != NULL && FD_ISSET(lec_params.ctrl_dist->fd, &rfds)) { ! diag(COMPONENT, DIAG_DEBUG, "get_bus_addr: ctrl.dist changed:"); retval = read_bus_arp(lec_params.ctrl_dist, addr, buff, sizeof(buff)); if (retval < 0) return -1; if (retval > 0) return retval; } ! diag(COMPONENT, DIAG_DEBUG, "get_bus_addr: consumed a packet"); } ! diag(COMPONENT, DIAG_ERROR, "Timeout while waiting for BUS LE_ARP response"); return 0; } *************** *** 748,756 **** frame_size = recv_frame(conn, buff, buffsize); if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "LES Control connection closed\n"); return -1; } if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERROR, "get_bus_arp: recv_frame: %s\n", strerror(errno)); return -1; } --- 748,756 ---- frame_size = recv_frame(conn, buff, buffsize); if (frame_size == 0) { ! diag(COMPONENT, DIAG_ERROR, "LES Control connection closed"); return -1; } if (frame_size < 0) { ! diag(COMPONENT, DIAG_ERR... [truncated message content] |
From: chas w. <ch...@us...> - 2003-07-19 22:24:54
|
Update of /cvsroot/linux-atm/linux-atm/src/br2684 In directory sc8-pr-cvs1:/tmp/cvs-serv15084 Modified Files: Tag: V2_5_0 br2684ctl.c Log Message: qos support from Adam Kaczynski <ka...@dg...> Index: br2684ctl.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/br2684/Attic/br2684ctl.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** br2684ctl.c 19 Jul 2003 22:03:28 -0000 1.1.2.1 --- br2684ctl.c 19 Jul 2003 22:24:51 -0000 1.1.2.2 *************** *** 79,86 **** ! int assign_vcc(char *astr, int encap, int bufsize) { int err; - struct atm_qos qos; struct sockaddr_atmpvc addr; int fd; --- 79,85 ---- ! int assign_vcc(char *astr, int encap, int bufsize, struct atm_qos qos) { int err; struct sockaddr_atmpvc addr; int fd; *************** *** 106,117 **** syslog(LOG_ERR,"failed to create socket %d, reason: %s", errno,strerror(errno)); ! ! memset(&qos, 0, sizeof(qos)); ! qos.aal = ATM_AAL5; ! qos.txtp.traffic_class = ATM_UBR; ! qos.txtp.max_sdu = 1524; ! qos.txtp.pcr = ATM_MAX_PCR; ! qos.rxtp = qos.txtp; ! if ( (err=setsockopt(fd,SOL_SOCKET,SO_SNDBUF, &bufsize ,sizeof(bufsize))) ) syslog(LOG_ERR,"setsockopt SO_SNDBUF: (%d) %s\n",err, strerror(err)); --- 105,116 ---- syslog(LOG_ERR,"failed to create socket %d, reason: %s", errno,strerror(errno)); ! if (qos.aal == 0) { ! qos.aal = ATM_AAL5; ! qos.txtp.traffic_class = ATM_UBR; ! qos.txtp.max_sdu = 1524; ! qos.txtp.pcr = ATM_MAX_PCR; ! qos.rxtp = qos.txtp; ! } ! if ( (err=setsockopt(fd,SOL_SOCKET,SO_SNDBUF, &bufsize ,sizeof(bufsize))) ) syslog(LOG_ERR,"setsockopt SO_SNDBUF: (%d) %s\n",err, strerror(err)); *************** *** 148,155 **** - void usage(char *s) { ! printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-a [itf.]vpi.vci]*]*\n", s); exit(1); } --- 147,153 ---- void usage(char *s) { ! printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-q qos] [-a [itf.]vpi.vci]*]*\n", s); exit(1); } *************** *** 160,173 **** { int c, background=0, encap=0, sndbuf=8192; ! lastsock=-1; lastitf=0; openlog (LOG_NAME,LOG_OPTION,LOG_FACILITY); if (argc>1) ! while ((c = getopt(argc, argv,"a:bc:e:s:?h")) !=EOF) switch (c) { case 'a': ! assign_vcc(optarg, encap, sndbuf); break; case 'b': --- 158,178 ---- { int c, background=0, encap=0, sndbuf=8192; ! struct atm_qos reqqos; lastsock=-1; lastitf=0; + /* st qos to 0 */ + memset(&reqqos, 0, sizeof(reqqos)); + openlog (LOG_NAME,LOG_OPTION,LOG_FACILITY); if (argc>1) ! while ((c = getopt(argc, argv,"q:a:bc:e:s:?h")) !=EOF) switch (c) { + case 'q': + printf ("optarg : %s",optarg); + if (text2qos(optarg,&reqqos,0)) fprintf(stderr,"QOS parameter invalid\n"); + break; case 'a': ! assign_vcc(optarg, encap, sndbuf, reqqos); break; case 'b': |