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...> - 2003-07-19 22:03:30
|
Update of /cvsroot/linux-atm/linux-atm/src/br2684 In directory sc8-pr-cvs1:/tmp/cvs-serv9154/src/br2684 Added Files: Tag: V2_5_0 Makefile.am br2684ctl.8 br2684ctl.c Log Message: add br2684ctl --- NEW FILE: Makefile.am --- sbin_PROGRAMS = br2684ctl LDADD = $(top_builddir)/src/lib/libatm.la br2684ctl_SOURCES = br2684ctl.c man_MANS = br2684ctl.8 EXTRA_DIST = $(man_MANS) USAGE.br2684 --- NEW FILE: br2684ctl.8 --- .\" .TH br2684ctl 1 "7 Jul 2003" .SH NAME br2684ctl \- RFC1483/2684 Bridge Daemon .SH SYNOPSIS .B br2684ctl [ .BI \-b ] [[ .BI \-c\ n ] [ .BI \-e\ 0|1 ] [ .BI \-s\ sndbuf ] [ .BI \-a\ [itf].vpi.vci ]] ... .SH PARAMETERS .TP 15 .BI \-a\ [itf].vpi.vci ATM PVC number, VPI and VCI. (Required) .BI \-b Puts the process in the background. .TP 15 .BI \-c\ n br2684 interface number such as 0, 1, ... (Required) .TP 15 .BI \-e\ 0|1 Encapsulation method: 0=LLC, 1=VC mux (the default is 0 or LLC) .TP 15 .TP 15 .BI \-s\ sndbuf Send buffer size. Default is 8192. .SH DESCRIPTION br2684ctl handles RFC1483/2684 bridged PDUs. This is most often used in ADSL scenarios where .I usually the subscribers' ethernet traffic is encapsulated in ATM AAL5 (by bridging ADSL modems) according to RFC2684. The subscriber-side ADSL modem can be external with an ethernet connector or an internal ADSL card in a PC. RFC1483 has been obsoleted by RFC2684. For example it is possible to set up your Linux box to handle several ATM PVC's with bridged-1483 (sometimes referred as SNAP) encapsulation. The Linux network stack might provide DHCP, IP masquerading, IP firewall services or bridge the Ethernet frames just like it had several ethernet interfaces. In fact it can have several (logical) ethernet interfaces, where ATM is just used as a carrier. .SH USAGE br2684ctl creates a new network interface named nas[n] which is bound to an specific ATM PVC. It requires two mandatory arguments: -c, the interface number, and -a, the ATM PVC. It should be noted that the order of the command arguments matter; -c should be followed by -a. You can create as many interfaces as necessary in one go, just make a long command line ;) For example, following command will create a nas0 interface which uses the ATM PVC with VPI=0 and VCI=401. You need to configure the PVC connection 0.401 on the ATM switch manually. % br2684ctl -c 0 -a 0.401 The command will only create a new interface nas0. Next step is to assign an IP address and netmask to the interface nas0 using the ifconfig command. Using ifconfig, you can also assign a Ethernet MAC address to the interface nas0, if necessary. % ifconfig nas0 192.168.2.1 netmask 255.255.255.0 .SH NOTES This man page is based on a tutorial by by Joonbum Byun <jb...@me...> .SH SEE ALSO .BR qos (7) --- NEW FILE: br2684ctl.c --- #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <sys/ioctl.h> #include <string.h> #include <syslog.h> #include <atm.h> #include <linux/atmdev.h> #include <linux/atmbr2684.h> /* Written by Marcell GAL <ce...@sc...> to make use of the */ /* ioctls defined in the br2684... kernel patch */ /* Compile with cc -o br2684ctl br2684ctl.c -latm */ /* Modified feb 2001 by Stephen Aaskov (sa...@la...) - Added daemonization code - Added syslog TODO: Delete interfaces after exit? */ #define LOG_NAME "RFC1483/2684 bridge" #define LOG_OPTION LOG_PERROR #define LOG_FACILITY LOG_LOCAL0 int lastsock, lastitf; void fatal(const char *str, int i) { syslog (LOG_ERR,"Fatal: %s",str); exit(-2); }; void exitFunc(void) { syslog (LOG_PID,"Daemon terminated\n"); } int create_br(char *nstr) { int num, err; if(lastsock<0) { lastsock = socket(PF_ATMPVC, SOCK_DGRAM, ATM_AAL5); } if (lastsock<0) { syslog(LOG_ERR, "socket creation failed: %s",strerror(errno)); } else { /* create the device with ioctl: */ num=atoi(nstr); if( num>=0 && num<1234567890){ struct atm_newif_br2684 ni; ni.backend_num = ATM_BACKEND_BR2684; ni.media = BR2684_MEDIA_ETHERNET; ni.mtu = 1500; sprintf(ni.ifname, "nas%d", num); err=ioctl (lastsock, ATM_NEWBACKENDIF, &ni); if (err == 0) syslog(LOG_INFO, "Interface \"%s\" created sucessfully\n",ni.ifname); else syslog(LOG_INFO, "Interface \"%s\" could not be created, reason: %s\n", ni.ifname, strerror(errno)); lastitf=num; /* even if we didn't create, because existed, assign_vcc wil want to know it! */ } else { syslog(LOG_ERR,"err: strange interface number %d", num ); } } return 0; } int assign_vcc(char *astr, int encap, int bufsize) { int err; struct atm_qos qos; struct sockaddr_atmpvc addr; int fd; struct atm_backend_br2684 be; memset(&addr, 0, sizeof(addr)); err=text2atm(astr,(struct sockaddr *)(&addr), sizeof(addr), T2A_PVC); if (err!=0) syslog(LOG_ERR,"Could not parse ATM parameters (error=%d)\n",err); #if 0 addr.sap_family = AF_ATMPVC; addr.sap_addr.itf = itf; addr.sap_addr.vpi = 0; addr.sap_addr.vci = vci; #endif syslog(LOG_INFO,"Communicating over ATM %d.%d.%d, encapsulation: %s\n", addr.sap_addr.itf, addr.sap_addr.vpi, addr.sap_addr.vci, encap?"VC mux":"LLC"); if ((fd = socket(PF_ATMPVC, SOCK_DGRAM, ATM_AAL5)) < 0) 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)); if (setsockopt(fd, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0) syslog(LOG_ERR,"setsockopt SO_ATMQOS %d", errno); err = connect(fd, (struct sockaddr*)&addr, sizeof(struct sockaddr_atmpvc)); if (err < 0) fatal("failed to connect on socket", err); /* attach the vcc to device: */ be.backend_num = ATM_BACKEND_BR2684; be.ifspec.method = BR2684_FIND_BYIFNAME; sprintf(be.ifspec.spec.ifname, "nas%d", lastitf); be.fcs_in = BR2684_FCSIN_NO; be.fcs_out = BR2684_FCSOUT_NO; be.fcs_auto = 0; be.encaps = encap ? BR2684_ENCAPS_VC : BR2684_ENCAPS_LLC; be.has_vpiid = 0; be.send_padding = 0; be.min_size = 0; err=ioctl (fd, ATM_SETBACKEND, &be); if (err == 0) syslog (LOG_INFO,"Interface configured"); else { syslog (LOG_ERR,"Could not configure interface:%s",strerror(errno)); exit(2); } return fd ; } void usage(char *s) { printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-a [itf.]vpi.vci]*]*\n", s); exit(1); } int main (int argc, char **argv) { 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': background=1; break; case 'c': create_br(optarg); break; case 'e': encap=(atoi(optarg)); if(encap<0){ syslog (LOG_ERR, "invalid encapsulation: %s:\n",optarg); encap=0; } break; case 's': sndbuf=(atoi(optarg)); if(sndbuf<0){ syslog(LOG_ERR, "Invalid sndbuf: %s, using size of 8192 instead\n",optarg); sndbuf=8192; } break; case '?': case 'h': default: usage(argv[0]); } else usage(argv[0]); if (argc != optind) usage(argv[0]); if(lastsock>=0) close(lastsock); 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 // Become a process group and session group leader if (setsid()<0) { fprintf (stderr,"Could not set process group\n"); exit(2); } // Fork again to let process group leader exit pid = fork(); if (pid < 0) { fprintf(stderr,"Error detaching during second fork\n"); exit(2); } else if (pid) exit(0); // This is the parent // Now we're ready for buisness chdir("/"); // Don't keep directories in use close(0); close(1); close(2); // Close stdin, -out and -error /* Note that this implementation does not keep an open stdout/err. If we need them they can be opened now */ } syslog (LOG_INFO, "RFC 1483/2684 bridge daemon started\n"); atexit (exitFunc); while (1) sleep(30); /* to keep the sockets... */ return 0; } |
From: chas w. <ch...@us...> - 2003-07-19 22:03:30
|
Update of /cvsroot/linux-atm/linux-atm/src In directory sc8-pr-cvs1:/tmp/cvs-serv9154/src Modified Files: Tag: V2_5_0 Makefile.am Log Message: add br2684ctl Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Makefile.am 9 Oct 2001 22:33:06 -0000 1.2 --- Makefile.am 19 Jul 2003 22:03:27 -0000 1.2.2.1 *************** *** 1,3 **** SUBDIRS = include lib test debug qgen saal sigd maint arpd ilmid man led lane \ ! mpoad switch config extra --- 1,3 ---- SUBDIRS = include lib test debug qgen saal sigd maint arpd ilmid man led lane \ ! mpoad switch config extra br2684 |
From: chas w. <ch...@us...> - 2003-07-19 22:03:30
|
Update of /cvsroot/linux-atm/linux-atm In directory sc8-pr-cvs1:/tmp/cvs-serv9154 Modified Files: Tag: V2_5_0 configure.in Log Message: add br2684ctl Index: configure.in =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/configure.in,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** configure.in 1 May 2003 13:23:57 -0000 1.2.2.2 --- configure.in 19 Jul 2003 22:03:27 -0000 1.2.2.3 *************** *** 170,173 **** --- 170,174 ---- src/switch/debug/Makefile \ src/switch/tcp/Makefile \ + src/br2684/Makefile \ src/config/Makefile \ src/config/init-redhat/Makefile \ |
From: chas w. <ch...@us...> - 2003-07-19 21:21:16
|
Update of /cvsroot/linux-atm/linux-atm/src/br2684 In directory sc8-pr-cvs1:/tmp/cvs-serv2328/br2684 Log Message: Directory /cvsroot/linux-atm/linux-atm/src/br2684 added to the repository --> Using per-directory sticky tag `V2_5_0' |
From: chas w. <ch...@us...> - 2003-07-19 21:20:45
|
Update of /cvsroot/linux-atm/linux-atm In directory sc8-pr-cvs1:/tmp/cvs-serv2236 Modified Files: Tag: V2_5_0 ChangeLog Log Message: updates about ilmid Index: ChangeLog =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/ChangeLog,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** ChangeLog 1 May 2003 13:23:17 -0000 1.2.2.2 --- ChangeLog 19 Jul 2003 21:20:43 -0000 1.2.2.3 *************** *** 1,2 **** --- 1,22 ---- + Version 2.4.1 to 2.5.0 (??-???-????) + ====================== + + Bug fixes + --------- + + - building outside the source tree should now work properly + - TimeTicks (in ilmid) should be unsigned + + New features + ------------ + + - zeppelin now has a -b option (run in background) + - zeppelin creates /var/run/lec[itf].pid at startup + - ilmid updates from ek...@cm... + + Other changes + ------------- + + Version 2.4.0 to 2.4.1 (25-APR-2003) ===================== |
From: chas w. <ch...@us...> - 2003-07-19 21:19:19
|
Update of /cvsroot/linux-atm/linux-atm/src/ilmid In directory sc8-pr-cvs1:/tmp/cvs-serv2028 Modified Files: Tag: V2_5_0 rfc1155_smi.h Log Message: TimeTicks should be unsigned (from ek...@cm...) Index: rfc1155_smi.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/rfc1155_smi.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** rfc1155_smi.h 9 Oct 2001 22:33:06 -0000 1.2 --- rfc1155_smi.h 19 Jul 2003 21:19:13 -0000 1.2.2.1 *************** *** 62,72 **** ! typedef AsnInt TimeTicks; /* [APPLICATION 3] IMPLICIT INTEGER (0..2147483647) */ ! #define BEncTimeTicksContent BEncAsnIntContent ! #define BDecTimeTicksContent BDecAsnIntContent ! #define PrintTimeTicks PrintAsnInt --- 62,72 ---- ! typedef UAsnInt TimeTicks; /* [APPLICATION 3] IMPLICIT INTEGER (0..2147483647) */ ! #define BEncTimeTicksContent BEncUAsnIntContent ! #define BDecTimeTicksContent BDecUAsnIntContent ! #define PrintTimeTicks PrintUAsnInt |
From: chas w. <ch...@us...> - 2003-07-19 21:07:22
|
Update of /cvsroot/linux-atm/linux-atm/src/ilmid In directory sc8-pr-cvs1:/tmp/cvs-serv29312 Modified Files: Tag: V2_5_0 Makefile.am atmf_uni.c atmf_uni.h ilmid.c io.c io.h message.c message.h mib.c mib.h Added Files: Tag: V2_5_0 actions.c actions.h ilmid.8 ilmid.h states.c states.h wait.c wait.h Log Message: ilmi updates from ek...@cm... --- NEW FILE: actions.c --- #include <unistd.h> #include <stdlib.h> #include <sys/time.h> #include <errno.h> #include "asn_incl.h" #include "rfc1155_smi.h" #include "rfc1157_snmp.h" #include "message.h" #include "util.h" #include "io.h" #include "atmd.h" #include "mib.h" #include "atmf_uni.h" #include "sysgroup.h" #include "ilmid.h" #define COMPONENT "ILMI" extern struct attachment_point *apoint; extern int retries; extern long int requestID; void action_A1( int fd, Msgs *msgs ){ /* Reset Uptime */ diag( COMPONENT, DIAG_INFO, "Action A1: reset uptime" ); resetUpTime(); } void action_A2( int fd, Msgs *msgs ){ /* Reset Attachment Point */ diag( COMPONENT, DIAG_INFO, "Action A2: reset attachment point" ); /* should probably use reset_apoint() here */ if( apoint->atmfPortMyIfName.octs ){ free( apoint->atmfPortMyIfName.octs ); apoint->atmfPortMyIfName.octs = NULL; } memset( apoint, 0, sizeof( struct attachment_point )); } void action_A3( int fd, Msgs *msgs ){ /* Set Attachment Point */ /* This doesn't really exist */ /* see copy_attachment_point() */ diag( COMPONENT, DIAG_INFO, "Action A3: set attachment point" ); } void action_A4( int fd, Msgs *msgs ){ /* Clear Tables */ diag( COMPONENT, DIAG_INFO, "Action A4: clear tables" ); deleteNetPrefix(); } void action_A5( int fd, Msgs *msgs ){ /* start timer */ /* Our timer is provided by select() */ diag( COMPONENT, DIAG_INFO, "Action A5: start timer" ); } void action_A6( int fd, Msgs *msgs ){ /* stop timer */ diag( COMPONENT, DIAG_INFO, "Action A6: stop timer" ); } void action_A7( int fd, Msgs *msgs ){ diag( COMPONENT, DIAG_INFO, "Action A7: clear retries" ); retries = 0; } void action_A8( int fd, Msgs *msgs ){ diag( COMPONENT, DIAG_INFO, "Action A8: increment retries" ); retries++; } void action_A9( int fd, Msgs *msgs ){ /* clear all SVCs */ /* not sure how to do this, yet */ diag( COMPONENT, DIAG_INFO, "Action A9: release SVCs" ); } void action_A10( int fd, Msgs *msgs ){ diag( COMPONENT, DIAG_INFO, "Action A10: start signalling" ); /* not sure how to do this, yet */ } void action_A11( int fd, Msgs *msgs ){ diag( COMPONENT, DIAG_INFO, "Action A11: set coldstart" ); (msgs->coldstart)->data->a.trap->time_stamp = accessUpTime(); send_message( fd, msgs->coldstart ); } /* Attachment point info */ /* ILMI spec - page 90 */ void action_A12( int fd, Msgs *msgs ){ diag( COMPONENT, DIAG_INFO, "Action A12: get attachment point" ); msgs->apointmsg->data->a.get_next_request->request_id = ++requestID; send_message( fd, msgs->apointmsg ); } /* Configuration info */ /* ILMI spec - page 90 */ void action_A13( int fd, Msgs *msgs ){ Message *config; diag( COMPONENT, DIAG_INFO, "Action A13: get configuration" ); /* don't actually get all of the config info -- we probably will not be using much of it anyway */ config = msgs->config; config->data->a.get_next_request->request_id = ++requestID; send_message( fd, config ); } void action_A14( int fd, Msgs *msgs ){ diag( COMPONENT, DIAG_INFO, "Action A14: send getNextRequest" ); msgs->addrtable->data->a.get_next_request->request_id = ++requestID; send_message( fd, msgs->addrtable ); } void action_A15( int fd, Msgs *msgs ){ diag( COMPONENT, DIAG_INFO, "Action A15: send set request" ); msgs->set->data->a.get_next_request->request_id = ++requestID; send_message( fd, msgs->set ); } void action_get_sysgroup( int fd, Msgs *msgs ){ diag( COMPONENT, DIAG_INFO, "Action Get Sysgroup: request system mib" ); msgs->sysmsg->data->a.get_request->request_id = ++requestID; send_message( fd, msgs->sysmsg ); } --- NEW FILE: actions.h --- #ifndef __ACTIONS_H #define __ACTIONS_H #include "ilmid.h" void action_A1( int fd, Msgs *msgs ); void action_A2( int fd, Msgs *msgs ); void action_A3( int fd, Msgs *msgs ); void action_A4( int fd, Msgs *msgs ); void action_A5( int fd, Msgs *msgs ); void action_A6( int fd, Msgs *msgs ); void action_A7( int fd, Msgs *msgs ); void action_A8( int fd, Msgs *msgs ); void action_A9( int fd, Msgs *msgs ); void action_A10( int fd, Msgs *msgs ); void action_A11( int fd, Msgs *msgs ); void action_A12( int fd, Msgs *msgs ); void action_A13( int fd, Msgs *msgs ); void action_A14( int fd, Msgs *msgs ); void action_A15( int fd, Msgs *msgs ); void action_get_sysgroup( int fd, Msgs *msgs ); #endif --- NEW FILE: ilmid.8 --- .\" .TH ilmid 1 "2 Aug 2001" .SH NAME ilmid \- Integrated Local Management Interface Daemon .SH SYNOPSIS .B ilmid [ .B \-b ] [ .B \-d ] [ .B \-v ] [ .BI \-l\ logfile ] [ .B \-x ] [ .BI \-q\ qos ] [ .BI \-i\ local_ip ] [ .BI \-u\ uni ] <interface> .SH PARAMETERS .TP 15 .B \-b Puts the process in the background. .TP 15 .B \-d Turn on debugging output. .TP 15 .B \-v Verbose. .TP 15 .BI \-l\ logfile Set the location of the log file. .TP 15 .B \-x No var bindings? .TP 15 .BI \-q\ qos Set the qos parameters to use on the ilmi VC. .TP 15 .BI \-i\ local_ip the address that should be used by the switch for network management. .TP 15 .BI \-u\ uni uni version. This can be 3.0, 3.1 or 4.0. .SH DESCRIPTION ilmid implements SNMP on an ATM PVC. It is used to negotiate operating parameters with a switch. .SH SEE ALSO .BR atmsigd (8) --- NEW FILE: ilmid.h --- #ifndef __ILMID_H #define __ILMID_H #define ECOLDSTART 1 #define ETIMEOUT 2 #define ESETPREFIX 3 #define EALARM 4 #include "message.h" #include "asn1/asn_incl.h" typedef struct { Message *apointmsg; Message *coldstart; Message *addrtable; Message *poll; Message *set; Message *config; Message *sysmsg; } Msgs; typedef struct attachment_point { AsnOcts atmfPortMyIfName; AsnInt atmfPortMyIfIdentifier; AsnOcts atmfMySystemIdentifier; AsnInt sysUpTime; // char sysIdMem[6]; } AttPoint; typedef struct configuration_info { AsnInt atmfAtmLayerUniVersion; AsnInt atmfAtmLayerMaxVpiBits; AsnInt atmfAtmLayerMaxVciBits; AsnInt atmfAtmLayerUniType; AsnInt atmfAtmLayerDeviceType; AsnInt atmfAddressRegistrationAdminStatus; } Config; typedef struct __sysgroup { AsnOcts sysDescr; AsnOcts sysObjectID; AsnInt sysUpTime; AsnOcts sysContact; AsnOcts sysName; AsnOcts sysLocation; AsnInt sysServices; } SysGroup; typedef enum _State { up, down } State; #endif --- NEW FILE: states.c --- #include <unistd.h> #include <sys/time.h> #include <errno.h> #include "asn_incl.h" #include "rfc1155_smi.h" #include "rfc1157_snmp.h" #include "message.h" #include "util.h" #include "io.h" #include "atmd.h" #include "mib.h" #include "atmf_uni.h" #include "states.h" #include "ilmid.h" #include "actions.h" #include "wait.h" extern int retries; extern int ilmi_errno; extern long int requestID; extern AsnOid *esi_oid; extern AttPoint *apoint; extern Config *config; extern int alarm_flag; extern State ilmi_state; extern AttPoint *newapoint; Message *wait_for_response( int fd, int itf, Msgs *msgs, int sec ); void copy_attachment_point( AttPoint *, AttPoint * ); int compare_attachment_point( AttPoint *, AttPoint * ); #define RESPONSE_TIMEOUT 2 #define POLL_PERIOD 15 #define COMPONENT "ILMI" /* state functions */ int state_stopped( int fd, int itf, Msgs *msgs ){ diag( COMPONENT, DIAG_INFO, "State S1: stopped" ); ilmi_state = down; action_A1( fd, msgs ); /* reset uptime */ action_A2( fd, msgs ); /* reset attachment point info */ action_A4( fd, msgs ); /* clear tables */ return S2; } int state_failing( int fd, int itf, Msgs *msgs ){ Message *m; diag( COMPONENT, DIAG_INFO, "State S2: failing" ); ilmi_state = down; action_A11( fd, msgs ); /* send coldstart */ action_A12( fd, msgs ); /* send "get" for attachment point */ /* continue to ask for attachment point as long as it times out */ while(( m = wait_for_attachment_point( fd, itf, msgs )) == NULL ){ if( ilmi_errno == ECOLDSTART ) return S1; action_A11( fd, msgs ); /* send coldstart */ action_A12( fd, msgs ); /* send "get" for attachment point */ } action_A11( fd, msgs ); /* one more for good measure */ return S3; } int state_establishing( int fd, int itf, Msgs *msgs ){ Message *m; diag( COMPONENT, DIAG_INFO, "State S3: establishing" ); ilmi_state = down; /* if they are the same ... */ if( compare_attachment_point( apoint, newapoint ) == 0 ){ action_A13( fd, msgs ); /* request config */ } else{ // reset_apoint( apoint ); /* copy( dest, src ) */ copy_attachment_point( apoint, newapoint ); /* action_A3 */ action_A9( fd, msgs ); /* release SVCs */ action_A13( fd, msgs ); /* request config */ action_A7( fd, msgs ); /* retries = 0 */ action_A5( fd, msgs ); /* start timer */ } while(( m = wait_for_config( fd, itf, msgs )) == NULL ){ if( ilmi_errno == ETIMEOUT ) action_A13( fd, msgs ); else if( ilmi_errno == ECOLDSTART ) return S1; } return S4; } int state_config( int fd, int itf, Msgs *msgs ){ Message *tmp; int newstate = S1; diag( COMPONENT, DIAG_INFO, "State S4: config" ); ilmi_state = down; if( config->atmfAtmLayerUniVersion == 0 ){ diag( COMPONENT, DIAG_ERROR, "remote IME did not negotiate " "a UNI version -- using configured uni version." ); } else if( config->atmfAtmLayerUniVersion < atmfAtmLayerUniVersionValue ){ diag( COMPONENT, DIAG_ERROR, "remote IME does not support" " the locally configured uni version" ); atmfAtmLayerUniVersionValue = config->atmfAtmLayerUniVersion; } if( config->atmfAtmLayerDeviceType == 2 /* NODE */ ){ action_A6( fd, msgs ); /* stop timer */ action_A10( fd, msgs ); /* Start signalling */ action_A14( fd, msgs ); /* request address status */ action_A7( fd, msgs ); /* retries = 0 */ action_A5( fd, msgs ); /* start timer */ newstate = S5; /* retrieve network prefixes */ } else if( config->atmfAtmLayerDeviceType == 1 /* USER */ ){ diag( COMPONENT, DIAG_ERROR, "Remote device is also a host" ); action_A10( fd, msgs ); /* start signalling */ action_A14( fd, msgs ); /* get next prefix */ action_A7( fd, msgs ); /* retries = 0 */ action_A5( fd, msgs ); /* start timer */ newstate = S6; } else if( config->atmfAtmLayerDeviceType == 0 /* ??? */ ){ diag( COMPONENT, DIAG_ERROR, "Remote IME does not know " "what type of device it is -- assume NODE" ); action_A6( fd, msgs ); /* stop timer */ action_A10( fd, msgs ); /* Start signalling */ action_A14( fd, msgs ); /* request address status */ action_A7( fd, msgs ); /* retries = 0 */ action_A5( fd, msgs ); /* start timer */ newstate = S5; /* retrieve network prefixes */ } while(( tmp = wait_for_status( fd, itf, msgs )) == NULL ){ if( ilmi_errno == ETIMEOUT ){ action_A14( fd, msgs ); /* request address status */ action_A8( fd, msgs ); /* retries++ */ action_A5( fd, msgs ); /* start timer */ } else if( ilmi_errno == ECOLDSTART ){ return S1; } } action_get_sysgroup( fd, msgs ); while(( tmp = wait_for_sysgroup( fd, itf, msgs )) == NULL ){ if( ilmi_errno == ETIMEOUT ){ action_get_sysgroup( fd, msgs ); action_A8( fd, msgs ); /* retries++ */ action_A5( fd, msgs ); /* start timer */ } else if( ilmi_errno == ECOLDSTART ){ return S1; } } return newstate; } int state_retrievePrefixes( int fd, int itf, Msgs *msgs ){ int newstate = S1; diag( COMPONENT, DIAG_INFO, "State S5: retrieve prefixes" ); ilmi_state = down; /* assume address registration is supported on peer */ wait_for_prefix( fd, itf, msgs ); newstate = S6; /* register network prefixes */ return newstate; } int state_registerPrefixes( int fd, int itf, Msgs *msgs ){ Message *m; diag( COMPONENT, DIAG_INFO, "State S6: register prefixes" ); ilmi_state = down; /* If RegistrationAdminStatus == 0, switch is confused. Assume * it supports registration. */ if(( config->atmfAddressRegistrationAdminStatus == 1 ) || ( config->atmfAddressRegistrationAdminStatus == 0 )){ action_A6( fd, msgs ); /* stop timer */ action_A15( fd, msgs ); /* set request for table entry */ action_A7( fd, msgs ); /* retries = 0 */ action_A5( fd, msgs ); /* start timer */ while(( m = wait_for_setresponse( fd, itf, msgs )) == NULL ){ if( ilmi_errno == ETIMEOUT ){ /* set request for table entry */ action_A15( fd, msgs ); action_A8( fd, msgs ); /* retries++ */ action_A5( fd, msgs ); /* start timer */ } else if( ilmi_errno == ECOLDSTART ){ return S1; } } } else{ diag( COMPONENT, DIAG_ERROR, "address registration not supported" ); action_A6( fd, msgs ); /* stop timer */ action_A12( fd, msgs ); /* request a.point */ action_A7( fd, msgs ); /* retries = 0 */ action_A5( fd, msgs ); /* start timer */ } return S9; /* verify */ } int state_retrieveAddresses( int fd, int itf, Msgs *msgs ){ /* This would only be called on a switch -- not yet implemented */ diag( COMPONENT, DIAG_INFO, "State S7: retrieve addresses" ); ilmi_state = down; return S9; } int state_registerAddresses( int fd, int itf, Msgs *msgs ){ /* not yet implemented */ diag( COMPONENT, DIAG_INFO, "State S8: register addresses" ); ilmi_state = down; return S9; } /* Should spend most of our time here */ /* ask for updates. if new prefix is set, update and notify user */ int state_verify( int fd, int itf, Msgs *msgs ){ Message *m; diag( COMPONENT, DIAG_INFO, "State S9: verify" ); ilmi_state = up; action_A6( fd, msgs ); /* stop timer */ action_A7( fd, msgs ); /* retries = 0 */ action_A5( fd, msgs ); /* start timer */ m = wait_for_response( fd, itf, msgs, POLL_PERIOD ); if(( m == NULL ) && ( ilmi_errno == ECOLDSTART )){ return S1; } else if( ilmi_errno == EALARM ){ /* interface information must be no older than 30 seconds */ alarm_flag = 0; action_A12( fd, msgs ); /* request attachment point */ while((( m = wait_for_attachment_point( fd, itf, msgs )) == NULL ) && ( retries < 4 )){ action_A12( fd, msgs ); action_A8( fd, msgs ); } if( retries >= 4 ) return S2; /* check for attachment point change */ } return S9; } --- NEW FILE: states.h --- #ifndef __STATES_H #define __STATES_H #include "message.h" #include "asn1/asn_incl.h" #include "ilmid.h" /* Ilmi states */ #define S1 0 #define S2 1 #define S3 2 #define S4 3 #define S5 4 #define S6 5 #define S7 6 #define S8 7 #define S9 8 #define STATES 9 int state_stopped( int fd, int itf, Msgs *msgs ); int state_failing( int fd, int itf, Msgs *msgs ); int state_establishing( int fd, int itf, Msgs *msgs ); int state_config( int fd, int itf, Msgs *msgs ); int state_retrievePrefixes( int fd, int itf, Msgs *msgs ); int state_registerPrefixes( int fd, int itf, Msgs *msgs ); int state_retrieveAddresses( int fd, int itf, Msgs *msgs ); int state_registerAddresses( int fd, int itf, Msgs *msgs ); int state_verify( int fd, int itf, Msgs *msgs ); #endif --- NEW FILE: wait.c --- #include <unistd.h> #include <stdlib.h> #include <sys/time.h> #include <errno.h> #include "asn_incl.h" #include "rfc1155_smi.h" #include "rfc1157_snmp.h" #include "message.h" #include "util.h" #include "io.h" #include "atmd.h" #include "mib.h" #include "atmf_uni.h" #include "sysgroup.h" #include "ilmid.h" extern int ilmi_errno; extern AttPoint *apoint; extern Config *config; extern SysGroup *remsys; Message *wait_for_response( int fd, int itf, Msgs *msgs, int sec ); void copy_attachment_point( AttPoint *, AttPoint * ); int compare_attachment_point( AttPoint *, AttPoint * ); extern AttPoint *newapoint; #define RESPONSE_TIMEOUT 2 #define POLL_PERIOD 15 #define COMPONENT "ILMI" /* support functions */ #define RESP_RID(x) ((x)->data->a.get_response->request_id) #define GETNEXT_RID(x) ((x)->data->a.get_next_request->request_id) void reset_apoint( AttPoint *a ){ if( a->atmfPortMyIfName.octs != NULL ){ free( a->atmfPortMyIfName.octs ); a->atmfPortMyIfName.octs = NULL; } if( a->atmfMySystemIdentifier.octs != NULL ){ free( a->atmfMySystemIdentifier.octs ); a->atmfMySystemIdentifier.octs = NULL; } memset( a, 0, sizeof( AttPoint )); } static void reset_remsys( void ){ if( remsys->sysDescr.octs != NULL ) free( remsys->sysDescr.octs ); if( remsys->sysObjectID.octs != NULL ) free( remsys->sysObjectID.octs ); if( remsys->sysContact.octs != NULL ) free( remsys->sysContact.octs ); if( remsys->sysName.octs != NULL ) free( remsys->sysName.octs ); if( remsys->sysLocation.octs != NULL ) free( remsys->sysLocation.octs ); memset( remsys, 0, sizeof( SysGroup )); } void wait_for_prefix( int fd, int itf, Msgs *msgs ){ while(( wait_for_response( fd, itf, msgs, RESPONSE_TIMEOUT ) != NULL ) && ( ilmi_errno != ESETPREFIX )); } static void AsnOctsCopy( dest, src ) AsnOcts *dest; AsnOcts *src; { if( src->octetLen > 0 ){ dest->octs = (char *)malloc( src->octetLen + 1 ); memset( dest->octs, 0, src->octetLen + 1 ); dest->octetLen = src->octetLen; memcpy( dest->octs, src->octs, src->octetLen ); } else { dest->octs = (char *)malloc( 8 ); dest->octetLen = 8; memcpy( dest->octs, "(empty)\0", 8 ); } } Message *wait_for_sysgroup( int fd, int itf, Msgs *msgs ){ Message *m = NULL; VarBind *varbind; VarBindList *vbl; m = wait_for_response( fd, itf, msgs, RESPONSE_TIMEOUT ); if( m == NULL ) return NULL; while( GETNEXT_RID( msgs->sysmsg ) != RESP_RID( m )) m = wait_for_response( fd, itf, msgs, RESPONSE_TIMEOUT ); reset_remsys(); vbl = m->data->a.get_response->variable_bindings; FOR_EACH_LIST_ELMT( varbind, vbl ){ if( AsnOidCompare( &sysDescr, &varbind->name ) == AsnOidEqual ){ AsnOctsCopy( &remsys->sysDescr, varbind->value->a.simple->a.string ); } else if( AsnOidCompare( &sysObjectID, &varbind->name ) == AsnOidEqual ){ AsnOctsCopy( &remsys->sysObjectID, varbind->value->a.simple->a.string ); } else if( AsnOidCompare( &sysUpTime, &varbind->name ) == AsnOidEqual ){ remsys->sysUpTime = varbind->value->a.simple->a.number; } else if( AsnOidCompare( &sysContact, &varbind->name ) == AsnOidEqual ){ AsnOctsCopy( &remsys->sysContact, varbind->value->a.simple->a.string ); } else if( AsnOidCompare( &sysName, &varbind->name ) == AsnOidEqual ){ AsnOctsCopy( &remsys->sysName, varbind->value->a.simple->a.string ); } else if( AsnOidCompare( &sysLocation, &varbind->name ) == AsnOidEqual ){ AsnOctsCopy( &remsys->sysLocation, varbind->value->a.simple->a.string ); } else if( AsnOidCompare( &sysServices, &varbind->name ) == AsnOidEqual ){ remsys->sysServices = varbind->value->a.simple->a.number; } } return m; } Message *wait_for_attachment_point( int fd, int itf, Msgs *msgs ){ Message *m = NULL; VarBind *varbind; VarBindList *vbl; m = wait_for_response( fd, itf, msgs, RESPONSE_TIMEOUT ); if( m == NULL ) return NULL; while( GETNEXT_RID( msgs->apointmsg ) != RESP_RID( m )){ m = wait_for_response( fd, itf, msgs, RESPONSE_TIMEOUT ); if( m == NULL ) return NULL; } reset_apoint( newapoint ); vbl = m->data->a.get_response->variable_bindings; FOR_EACH_LIST_ELMT( varbind, vbl ){ if( AsnOidCompare( &atmfMySystemIdentifier, &varbind->name ) == AsnOidEqual ){ AsnOctsCopy( &(newapoint->atmfMySystemIdentifier), varbind->value->a.simple->a.string ); } else if( AsnOidCompare( &atmfPortMyIdentifier, &varbind->name ) == AsnOidEqual ){ newapoint->atmfPortMyIfIdentifier = varbind->value->a.simple->a.number; } else if( AsnOidCompare( &sysUpTime, &varbind->name ) == AsnOidEqual ){ newapoint->sysUpTime = varbind->value->a.simple->a.number; } else if( AsnOidCompare( &atmfPortMyIfName, &varbind->name ) == AsnOidEqual ){ AsnOctsCopy( &(newapoint->atmfPortMyIfName), varbind->value->a.simple->a.string ); } } return m; } Message *wait_for_config( int fd, int itf, Msgs *msgs ){ Message *m = NULL; VarBind *varbind; VarBindList *vbl; m = wait_for_response( fd, itf, msgs, RESPONSE_TIMEOUT ); if( m == NULL ) return NULL; if( RESP_RID( m ) != GETNEXT_RID( msgs->config )){ diag( COMPONENT, DIAG_ERROR, "received response with invalid request id" ); } vbl = m->data->a.get_response->variable_bindings; FOR_EACH_LIST_ELMT( varbind, vbl ){ if( AsnOidCompare( &atmfAtmLayerDeviceType, &varbind->name ) == AsnOidEqual ) config->atmfAtmLayerDeviceType = varbind->value->a.simple->a.number; else if( AsnOidCompare( &atmfAtmLayerUniVersion, &varbind->name ) == AsnOidEqual ) config->atmfAtmLayerUniVersion = varbind->value->a.simple->a.number; else if( AsnOidCompare( &atmfAtmLayerUniType, &varbind->name ) == AsnOidEqual ) config->atmfAtmLayerUniType = varbind->value->a.simple->a.number; else if( AsnOidCompare( &atmfAtmLayerMaxVpiBits, &varbind->name ) == AsnOidEqual ) config->atmfAtmLayerMaxVpiBits = varbind->value->a.simple->a.number; else if( AsnOidCompare( &atmfAtmLayerMaxVciBits, &varbind->name ) == AsnOidEqual ) config->atmfAtmLayerMaxVciBits = varbind->value->a.simple->a.number; else if( AsnOidCompare( &atmfAddressRegistrationAdminStatus, &varbind->name ) == AsnOidEqual ) config->atmfAddressRegistrationAdminStatus = varbind->value->a.simple->a.number; } return m; } Message *wait_for_status( int fd, int itf, Msgs *msgs ){ Message *m = NULL; m = wait_for_response( fd, itf, msgs, RESPONSE_TIMEOUT ); if( m == NULL ) return NULL; while( RESP_RID( m ) != GETNEXT_RID( msgs->addrtable )){ m = wait_for_response( fd, itf, msgs, RESPONSE_TIMEOUT ); if( m == NULL ) return NULL; } return m; } Message *wait_for_setresponse( int fd, int itf, Msgs *msgs ){ Message *m = NULL; m = wait_for_response( fd, itf, msgs, RESPONSE_TIMEOUT ); return m; } --- NEW FILE: wait.h --- #ifndef __WAIT_H #define __WAIT_H #include "ilmid.h" void wait_for_prefix( int fd, int itf, Msgs *msgs ); Message *wait_for_sysgroup( int fd, int itf, Msgs *msgs ); Message *wait_for_attachment_point( int fd, int itf, Msgs *msgs ); Message *wait_for_config( int fd, int itf, Msgs *msgs ); Message *wait_for_status( int fd, int itf, Msgs *msgs ); Message *wait_for_setresponse( int fd, int itf, Msgs *msgs ); void reset_apoint( AttPoint *a ); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/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:16 -0000 1.2.2.1 --- Makefile.am 19 Jul 2003 21:07:19 -0000 1.2.2.2 *************** *** 8,15 **** util.c util.h io.c io.h message.c message.h \ atmf_uni.c atmf_uni.h mib.c mib.h \ ! sysgroup.c sysgroup.h ilmid.c ilmid_LDADD = $(top_builddir)/src/lib/libatm.la \ $(top_builddir)/src/ilmid/asn1/libasn1.a ilmid_DEPENDENCIES = $(ilmid_LDADD) EXTRA_DIST = COPYRIGHT --- 8,18 ---- util.c util.h io.c io.h message.c message.h \ atmf_uni.c atmf_uni.h mib.c mib.h \ ! sysgroup.c sysgroup.h ilmid.c \ ! wait.c wait.h states.c states.h actions.c actions.h ilmid_LDADD = $(top_builddir)/src/lib/libatm.la \ $(top_builddir)/src/ilmid/asn1/libasn1.a ilmid_DEPENDENCIES = $(ilmid_LDADD) + + man_MANS = ilmid.8 EXTRA_DIST = COPYRIGHT Index: atmf_uni.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/atmf_uni.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** atmf_uni.c 9 Oct 2001 22:33:06 -0000 1.2 --- atmf_uni.c 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 38,42 **** --- 38,47 ---- #define INVALID 2 + AsnOid foreQ2931AdminConfigType = + {19, "\53\06\01\04\01\202\106\02\02\02\01\06\02\01\01\01\13\00\00" }; + AsnOid foreQ2931NNIProto = + {19, "\53\06\01\04\01\202\106\02\02\02\01\06\02\01\01\01\102\00\00" }; AsnOid atmfPortIndex = {13, "\53\06\01\04\01\202\141\02\01\01\01\01\00"}; + AsnOid atmfPortMyIfName = {13, "\53\06\01\04\01\202\141\02\01\01\01\07\00"}; AsnOid atmfPortMyIdentifier = {13, "\53\06\01\04\01\202\141\02\01\01\01\10\00"}; AsnOid atmfMyIpNmAddress = {11, "\53\06\01\04\01\202\141\02\01\02\00"}; *************** *** 44,49 **** --- 49,84 ---- AsnOid atmfAtmLayerMaxVpiBits = {13, "\53\06\01\04\01\202\141\02\02\01\01\6\00"}; AsnOid atmfAtmLayerMaxVciBits = {13, "\53\06\01\04\01\202\141\02\02\01\01\7\00"}; + AsnOid atmfAtmLayerUniType = {13, "\53\06\01\04\01\202\141\02\02\01\01\10\00"}; AsnOid atmfAtmLayerUniVersion = {13, "\53\06\01\04\01\202\141\02\02\01\01\11\00"}; + AsnOid atmfAtmLayerDeviceType = {13, "\53\06\01\04\01\202\141\02\02\01\01\12\00"}; + AsnOid atmfAtmLayerIlmiVersion = {13, "\53\06\01\04\01\202\141\02\02\01\01\13\00"}; + AsnOid atmfAtmLayerNniSigVersion = {13, "\53\06\01\04\01\202\141\02\02\01\01\14\00"}; AsnOid atmfNetPrefixStatus = {NETPREFIX_LEN, "\53\06\01\04\01\202\141\02\07\01\01\03"}; + AsnOid atmfSrvcRegATMAddress = + // {26, "\53\06\01\04\01\202\141\02\10\01\01\03\00\12\01\03\06\01\04\01\202\141\01\05\01\01"}; + {25, "\53\06\01\04\01\202\141\02\10\01\01\03\00\12\01\03\06\01\04\01\202\141\01\05\01"}; + + + AsnOid atmfSrvcRegTable = { 10, "\53\06\01\04\01\202\141\02\10\01" }; + AsnOid atmfAddressTable = { 9, "\53\06\01\04\01\202\141\02\06" }; + AsnOid atmfAddressStatus = { 12, "\53\06\01\04\01\202\141\02\06\01\01\03" }; + AsnOid atmfAddressRegistrationAdminStatus = + { 13, "\53\06\01\04\01\202\141\02\13\01\01\02\00" }; + + /* 1 = PublicUNI + 2 = automode + 3 = iisp + 4 = ftPNNI + 5 = privateNNI + 6 = privateUNI + */ + AsnInt foreQ2931AdminConfigTypeValue = 6; /* private uni */ + + /* 1 = none + 2 = ftpnni + 3 = forum-pnni + 4 = iisp + */ + AsnInt foreQ2931NNIProtoValue = 1; /* none */ AsnInt atmfPortIndexValue = 0; *************** *** 55,59 **** AsnInt atmfAtmLayerMaxVpiBitsValue; AsnInt atmfAtmLayerMaxVciBitsValue; ! #if defined(UNI30) || defined(DYNAMIC_UNI) --- 90,97 ---- AsnInt atmfAtmLayerMaxVpiBitsValue; AsnInt atmfAtmLayerMaxVciBitsValue; ! AsnInt atmfAtmLayerUniTypeValue = 2; /* private */ ! AsnInt atmfAtmLayerDeviceTypeValue = 1; /* user (ATM End System) */ ! AsnInt atmfAtmLayerIlmiVersionValue = 2; /* version4point0 */ ! AsnInt atmfAtmLayerNniSigVersionValue = 1; /* unsupported */ #if defined(UNI30) || defined(DYNAMIC_UNI) *************** *** 68,71 **** --- 106,110 ---- static AsnOid atmNetPrefix = {0, NULL}; + static AsnOcts atmLecsAddress = {0, NULL}; typedef struct NetPrefixNode *************** *** 111,114 **** --- 150,154 ---- AsnOid *varBindName; + diag(COMPONENT,DIAG_DEBUG,"getNetPrefix"); varBindName = &varbind->name; if(AsnOidSize(varBindName) != NETPREFIX_LEN + INDEX_LEN || *************** *** 165,168 **** --- 205,209 ---- AsnOid *varBindName; + diag(COMPONENT,DIAG_DEBUG,"setNetPrefix"); varBindName = &varbind->name; if(varbind->value->choiceId != OBJECTSYNTAX_SIMPLE || *************** *** 203,204 **** --- 244,275 ---- return NOERROR; } + + AsnInt getLecsAddress(VarBind *varbind, Variable *var) + { + int cmp; + NetPrefixNode *prefix; + AsnOid *varBindName; + + diag(COMPONENT,DIAG_INFO,"getLecsAddress" ); + varBindName = &varbind->name; + if(AsnOidSize(varBindName) != 25 ) return NOSUCHNAME; + + /* + for(prefix = (NetPrefixNode *) var->value, cmp = AsnOidLess; + prefix != NULL && (cmp = AsnOidCompare(varBindName, prefix->name)) < + AsnOidEqual; + prefix = prefix->next); + + if(cmp != AsnOidEqual) + return NOSUCHNAME; + */ + + varbind->value = Asn1Alloc(sizeof(struct ObjectSyntax)); + varbind->value->choiceId = OBJECTSYNTAX_SIMPLE; + varbind->value->a.simple = Asn1Alloc(sizeof(struct SimpleSyntax)); + varbind->value->a.simple->choiceId = SIMPLESYNTAX_NUMBER; + varbind->value->a.simple->a.number = VALID; + + return NOERROR; + } + Index: atmf_uni.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/atmf_uni.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** atmf_uni.h 9 Oct 2001 22:33:06 -0000 1.2 --- atmf_uni.h 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 30,34 **** --- 30,37 ---- #include "mib.h" + extern AsnOid foreQ2931NNIProto; + extern AsnOid foreQ2931AdminConfigType; extern AsnOid atmfPortIndex; + extern AsnOid atmfPortMyIfName; extern AsnOid atmfPortMyIdentifier; extern AsnOid atmfMyIpNmAddress; *************** *** 37,42 **** --- 40,56 ---- extern AsnOid atmfAtmLayerMaxVpiBits; extern AsnOid atmfAtmLayerMaxVciBits; + extern AsnOid atmfAtmLayerUniType; extern AsnOid atmfAtmLayerUniVersion; + extern AsnOid atmfAtmLayerDeviceType; + extern AsnOid atmfAtmLayerIlmiVersion; + extern AsnOid atmfAtmLayerNniSigVersion; + extern AsnOid atmfSrvcRegATMAddress; + extern AsnOid atmfSrvcRegTable; + extern AsnOid atmfAddressTable; + extern AsnOid atmfAddressStatus; + extern AsnOid atmfAddressRegistrationAdminStatus; + extern AsnInt foreQ2931NNIProtoValue; + extern AsnInt foreQ2931AdminConfigTypeValue; extern AsnInt atmfPortIndexValue; extern IpAddress atmfMyIpNmAddressValue; *************** *** 44,48 **** --- 58,66 ---- extern AsnInt atmfAtmLayerMaxVpiBitsValue; extern AsnInt atmfAtmLayerMaxVciBitsValue; + extern AsnInt atmfAtmLayerUniTypeValue; extern AsnInt atmfAtmLayerUniVersionValue; + extern AsnInt atmfAtmLayerDeviceTypeValue; + extern AsnInt atmfAtmLayerIlmiVersionValue; + extern AsnInt atmfAtmLayerNniSigVersionValue; AsnOid *accessNetPrefix(void); *************** *** 52,55 **** --- 70,77 ---- AsnInt setNetPrefix(VarBind *varbind, Variable *var); AsnInt getMyIp(VarBind *varbind, Variable *var); + + AsnOid *accessLecsAddress( void ); + AsnInt setLecsAddress(VarBind *varbind, Variable *var); + AsnInt getLecsAddress(VarBind *varbind, Variable *var); #endif Index: ilmid.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/ilmid.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** ilmid.c 9 Oct 2001 22:33:06 -0000 1.2 --- ilmid.c 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 30,33 **** --- 30,37 ---- */ + /* + * Reference material used: af-ilmi-0065.000 + */ + #if HAVE_CONFIG_H #include <config.h> *************** *** 35,40 **** --- 39,48 ---- #include <unistd.h> + #include <stdlib.h> + #include <stdarg.h> #include <sys/time.h> + #include <sys/types.h> #include <errno.h> + #include <signal.h> #include "asn_incl.h" #include "rfc1155_smi.h" *************** *** 47,50 **** --- 55,59 ---- #include "atmf_uni.h" #include "sysgroup.h" + #include "states.h" #define RESPONSE_TIMEOUT 2 *************** *** 52,64 **** #define COMPONENT "ILMI" ! typedef enum IlmiState { NO_CHANGE, RESTART, VERIFY, NET_PREFIX, ! ADDRESS, POLL, IDLE } IlmiState; ! const char *state2text[7] = { "NO_CHANGE", "RESTART", "VERIFY", "NET_PREFIX", ! "ADDRESS", "POLL", "IDLE" }; ! void usage(char *name); ! void ilmi_loop(int fd, int itf); ! void usage(char *name) ! { fprintf(stderr, "usage: %s [-b] [-d] [-v] [-l logfile] [-x] [-q qos]\n" "%13s[ -i local_ip ] [ -u uni ] <interface>\n",name,""); --- 61,112 ---- #define COMPONENT "ILMI" ! /* Globals */ ! /* ! static const char *state_names[STATES] = { ! "Stopped", ! "Link Failing", ! "Establishing", ! "Configuring", ! "Retrieve Network Prefixes", ! "Registering Network Prefixes", ! "Retrieving Addresses", ! "Registering Addresses", ! "Verifying" ! }; ! */ ! typedef int (*Func)(int,int,Msgs *); ! static Func state_functions[STATES] = { ! state_stopped, ! state_failing, ! state_establishing, ! state_config, ! state_retrievePrefixes, ! state_registerPrefixes, ! state_retrieveAddresses, ! state_registerAddresses, ! state_verify ! }; ! ! AsnOid *esi_oid = NULL; ! int retries = 0; ! int ilmi_errno = 0; ! int alarm_flag = 0; ! long int requestID = 0; ! State ilmi_state = down; ! ! AttPoint _apoint; ! AttPoint *apoint = &_apoint; /* attachment point */ ! Config _config; ! Config *config = &_config; /* Remote IME configuration */ ! SysGroup _remsys; ! SysGroup *remsys = &_remsys; ! AttPoint _newapoint; ! AttPoint *newapoint = &_newapoint; ! ! void usage( char * ); ! void ilmi_loop( int, int ); ! ! void usage( char *name ){ fprintf(stderr, "usage: %s [-b] [-d] [-v] [-l logfile] [-x] [-q qos]\n" "%13s[ -i local_ip ] [ -u uni ] <interface>\n",name,""); *************** *** 67,141 **** } ! void ilmi_loop(int fd, int itf) ! { ! int no_response; ! long int requestID; ! Message *poll_message, *set_message, *coldstart_message, *in_message; ! AsnOid *set_oid, *netprefix_oid, *esi_oid; VarBind *varbind; ! struct timeval timeout; ! IlmiState state, new_state; ! ! resetUpTime(); ! poll_message = create_poll_message(); ! set_message = create_set_message(); ! set_oid = &((VarBind *) FIRST_LIST_ELMT(set_message->data->a.set_request->variable_bindings))->name; ! esi_oid = get_esi(fd,itf); ! coldstart_message = create_coldstart_message(); ! in_message = alloc_t(Message); ! ! /* Address registration state machine */ ! new_state = RESTART; ! for(;;) ! { ! state = new_state; ! diag(COMPONENT, DIAG_DEBUG, "entering state %s", state2text[state]); ! ! /* Output for the current state */ ! switch(state) ! { ! case RESTART: ! deleteNetPrefix(); ! diag(COMPONENT, DIAG_INFO, "sending cold-start"); ! coldstart_message->data->a.trap->time_stamp = accessUpTime(); ! send_message(fd, coldstart_message); ! no_response = 0; ! ! case VERIFY: ! diag(COMPONENT, DIAG_INFO, "sending get-next"); ! poll_message->data->a.get_next_request->request_id = ++requestID; ! send_message(fd, poll_message); ! break; ! case ADDRESS: ! diag(COMPONENT, DIAG_INFO, "setting the atm address on the switch"); ! set_message->data->a.set_request->request_id = ++requestID; ! send_message(fd, set_message); ! break; ! case POLL: ! diag(COMPONENT, DIAG_INFO, "sending get-next request"); ! poll_message->data->a.get_next_request->request_id = ++requestID; ! send_message(fd, poll_message); ! break; } ! /* Set the time-out period */ ! if(state == IDLE) ! timeout.tv_sec = POLL_PERIOD; ! else ! timeout.tv_sec = RESPONSE_TIMEOUT; ! timeout.tv_usec = 0; - new_state = NO_CHANGE; - /* Input handling loop */ - while(new_state == NO_CHANGE) - { - ResetNibbleMem(); - if(wait_for_message(fd, &timeout) && - !read_message(fd, in_message)) - { - switch(in_message->data->choiceId) - { case PDUS_GET_REQUEST: diag(COMPONENT, DIAG_INFO, "received get request"); --- 115,154 ---- } ! /* returns non-zero if switch set a prefix */ ! int handle_set_request( int fd, int itf, Msgs *msgs, Message *m ){ ! VarBindList *vbl; VarBind *varbind; ! AsnOid *netprefix_oid, *set_oid; ! /* use varbind to compare OIDs of incoming message and that of ! an address status message */ ! varbind = (VarBind *)FIRST_LIST_ELMT( ! m->data->a.get_request->variable_bindings ); ! if( AsnOidCompare( &atmfNetPrefixStatus, &varbind->name ) == AsnOidRoot ){ ! vbl = msgs->set->data->a.set_request->variable_bindings; ! set_oid = &((VarBind *)FIRST_LIST_ELMT( vbl ))->name; ! netprefix_oid = accessNetPrefix(); ! if( netprefix_oid != NULL ){ ! diag( COMPONENT, DIAG_INFO, ! "switch registered a network prefix"); ! set_oid->octetLen = ADDRESS_LEN + 1; ! AsnOidAppend( set_oid, netprefix_oid ); ! AsnOidAppend( set_oid, esi_oid ); ! update_nsap( itf, netprefix_oid, esi_oid ); ! return 1; ! } else{ ! diag( COMPONENT, DIAG_INFO, ! "switch did not register prefix?" ); ! } ! } ! return 0; } ! /* returns E value (ECOLDSTART, . . .) */ ! int handle_request( int fd, int itf, Msgs *msgs, Message *in_message ){ ! int retval = 0; ! switch( in_message->data->choiceId ){ case PDUS_GET_REQUEST: diag(COMPONENT, DIAG_INFO, "received get request"); *************** *** 156,202 **** break; - case PDUS_GET_RESPONSE: - diag(COMPONENT, DIAG_INFO, "received get response"); - if(in_message->data->a.get_response->request_id == requestID) - { - varbind = (VarBind *) FIRST_LIST_ELMT(in_message->data->a.get_response->variable_bindings); - switch(state) - { - case RESTART: - case VERIFY: - if(in_message->data->a.get_response->error_status == NOERROR && - AsnOidCompare(&atmAddressStatus, &varbind->name) == AsnOidRoot) - new_state = RESTART; - else - new_state = NET_PREFIX; - break; - - case ADDRESS: - if(in_message->data->a.get_response->error_status == NOERROR) - { - diag(COMPONENT, DIAG_INFO, "ATM address registered"); - update_nsap(itf, netprefix_oid, esi_oid); - no_response = 0; - new_state = POLL; - } - else - new_state = RESTART; - break; - - case POLL: - if(in_message->data->a.get_response->error_status == NOERROR && - AsnOidCompare(&varbind->name, set_oid) == AsnOidEqual) - { - no_response = 0; - new_state = IDLE; - } - else - new_state = RESTART; - break; - } - } - else diag(COMPONENT, DIAG_ERROR, "received response with invalid request id"); - break; - case PDUS_SET_REQUEST: diag(COMPONENT, DIAG_INFO, "received set request"); --- 169,172 ---- *************** *** 205,274 **** &in_message->data->a.set_request->error_index); in_message->data->choiceId = PDUS_GET_RESPONSE; send_message(fd, in_message); break; case PDUS_TRAP: ! diag(COMPONENT, DIAG_INFO, "received trap"); ! if(in_message->data->a.trap->generic_trap == COLDSTART && ! state != RESTART) ! new_state = RESTART; break; ! default: ! diag(COMPONENT, DIAG_ERROR, "received message with invalid choice"); break; } ! if((state == NET_PREFIX || new_state == NET_PREFIX) && ! (netprefix_oid = accessNetPrefix()) != NULL) ! { ! diag(COMPONENT, DIAG_INFO, "switch registered a network prefix"); ! set_oid->octetLen = ADDRESS_LEN + 1; ! AsnOidAppend(set_oid, netprefix_oid); ! AsnOidAppend(set_oid, esi_oid); ! new_state = ADDRESS; } } ! else /* Timeout occurred */ ! { ! switch(state) ! { ! case RESTART: ! case VERIFY: ! diag(COMPONENT, DIAG_INFO, "switch did not respond to get-next -- resending"); ! if(++no_response == 4) ! new_state = RESTART; ! else ! new_state = VERIFY; ! break; ! case NET_PREFIX: ! diag(COMPONENT, DIAG_INFO, "switch did not register a network prefix -- restarting"); ! new_state = RESTART; ! break; ! case ADDRESS: ! diag(COMPONENT, DIAG_INFO, "switch did not respond to set request -- resending"); ! new_state = ADDRESS; ! break; ! case POLL: ! if(++no_response == 4) ! { ! new_state = RESTART; ! diag(COMPONENT, DIAG_INFO, "switch is not responding"); } - else - new_state = IDLE; - break; - case IDLE: - new_state = POLL; - break; } } } } } int main(int argc, char *argv[]) { ! int fd, opt, itf = 0, bg = 0; pid_t pid; const char *qos; set_application("ilmid"); --- 175,354 ---- &in_message->data->a.set_request->error_index); in_message->data->choiceId = PDUS_GET_RESPONSE; + if( handle_set_request( fd, itf, msgs, in_message )) + retval = ESETPREFIX; send_message(fd, in_message); break; case PDUS_TRAP: ! if( in_message->data->a.trap->generic_trap == COLDSTART ){ ! diag( COMPONENT, DIAG_INFO, "received coldstart trap" ); ! retval = ECOLDSTART; ! } else diag( COMPONENT, DIAG_INFO, "received trap" ); break; ! ! case PDUS_GET_RESPONSE: break; } ! return retval; } + + /* if a non-null value is returned from this function, the caller must + free that memory */ + + Message *wait_for_response( int fd, int itf, Msgs *msgs, int sec ){ + Message *in_message; + static Message m; + struct timeval timeout; + int numfds = 0; + + in_message = (Message *)(&m); + timeout.tv_sec = sec; + timeout.tv_usec = 0; + + ilmi_errno = 0; + wait_top: + ResetNibbleMem(); + numfds = wait_for_message( fd, &timeout ); + if(( numfds > 0 ) && !read_message( fd, in_message )){ + switch( in_message->data->choiceId ){ + case PDUS_GET_REQUEST: + case PDUS_GET_NEXT_REQUEST: + case PDUS_SET_REQUEST: + case PDUS_TRAP: + ilmi_errno = + handle_request( fd, itf, msgs, in_message ); + if( ilmi_errno > 0 ) return NULL; + else goto wait_top; + /* no more evil than "break" */ + case PDUS_GET_RESPONSE: + diag( COMPONENT, DIAG_INFO, + "received get-response" ); + return in_message; + default: + diag( COMPONENT, DIAG_ERROR, + "received message with invalid choice" ); + goto wait_top; } ! } else{ ! if( numfds == 0 ) ilmi_errno = ETIMEOUT; ! if(( numfds < 0 ) && ( errno == EINTR )) ilmi_errno = EALARM; ! return NULL; /* no data read */ } } + + Msgs *create_msgs( void ){ + Msgs *m = alloc_t( Msgs ); + if( m == NULL ) return NULL; + + m->coldstart = create_coldstart_message(); + m->addrtable = create_va_getnext_message( 2, + &atmfAddressStatus, + &atmfSrvcRegTable ); + m->poll = create_getnext_message( atmfAddressTable ); + m->set = create_set_message(); + m->config = create_va_get_message( 6, + &atmfAtmLayerUniVersion, + &atmfAtmLayerMaxVpiBits, + &atmfAtmLayerMaxVciBits, + &atmfAtmLayerUniType, + &atmfAtmLayerDeviceType, + &atmfAddressRegistrationAdminStatus ); + m->apointmsg = create_va_get_message( 3, + &atmfPortMyIdentifier, + &atmfPortMyIfName, /* some extra adjacency info */ + &atmfMySystemIdentifier, + &sysUpTime ); + m->sysmsg = create_va_get_message( 7, + &sysDescr, + &sysObjectID, + &sysUpTime, + &sysContact, + &sysName, + &sysLocation, + &sysServices ); + + return m; + } + + void copy_attachment_point( AttPoint *dest, AttPoint *src ){ + dest->sysUpTime = src->sysUpTime; + dest->atmfPortMyIfIdentifier = src->atmfPortMyIfIdentifier; + + dest->atmfMySystemIdentifier.octs = + malloc( src->atmfMySystemIdentifier.octetLen ); + dest->atmfMySystemIdentifier.octetLen = + src->atmfMySystemIdentifier.octetLen; + if( dest->atmfMySystemIdentifier.octs != NULL ){ + memcpy( dest->atmfMySystemIdentifier.octs, + src->atmfMySystemIdentifier.octs, 6 ); + } else diag( COMPONENT, DIAG_FATAL, "malloc() failed" ); + + /* copy the port name */ + dest->atmfPortMyIfName.octs = + malloc( src->atmfPortMyIfName.octetLen + 1 ); + dest->atmfPortMyIfName.octetLen = src->atmfPortMyIfName.octetLen; + if( dest->atmfPortMyIfName.octs != NULL ){ + memcpy( dest->atmfPortMyIfName.octs, + src->atmfPortMyIfName.octs, + src->atmfPortMyIfName.octetLen ); + } else diag( COMPONENT, DIAG_FATAL, "malloc() failed" ); + } + + /* section 8.3.2 */ + int compare_attachment_point( a, b ) + AttPoint *a; /* current a'point */ + AttPoint *b; /* newly aquired a'point info */ + { + if(( a == NULL ) || ( b == NULL )) return -1; + if( a->atmfPortMyIfIdentifier != b->atmfPortMyIfIdentifier ) + return -1; + if( a->atmfMySystemIdentifier.octetLen != + b->atmfMySystemIdentifier.octetLen ) return -1; + if( memcmp( a->atmfMySystemIdentifier.octs, + b->atmfMySystemIdentifier.octs, + b->atmfMySystemIdentifier.octetLen ) != 0 ) return -1; + if( b->sysUpTime < a->sysUpTime ) return -1; + return 0; } + + void handler( int sig ){ + switch( sig ){ + case SIGALRM: + alarm_flag = 1; + diag( COMPONENT, DIAG_INFO, + "received alarm: time to poll for attachment point" ); + break; + case SIGTERM: + case SIGSTOP: + case SIGINT: + case SIGKILL: + ilmi_state = down; + exit( 1 ); } } + + void ilmi_loop( int fd, int itf ){ + int state = S1; + Msgs *msgs = create_msgs(); + struct itimerval setpoint; + esi_oid = get_esi( fd, itf); + // apoint->atmfMySystemIdentifier.octs = &(apoint->sysIdMem[0]); + + setpoint.it_interval.tv_sec = 30; + setpoint.it_interval.tv_usec = 0; + setpoint.it_value.tv_sec = 30; + setpoint.it_value.tv_usec = 0; + signal( SIGALRM, handler ); + setitimer( ITIMER_REAL, &setpoint, NULL ); + + for( ;; ) state = state_functions[state]( fd, itf, msgs ); } int main(int argc, char *argv[]) { ! int opt, bg = 0; pid_t pid; const char *qos; + int fd, itf = 0; set_application("ilmid"); *************** *** 307,311 **** case 'u': { ! int version; if (!strcmp(optarg,"3.0") || !strcmp(optarg,"30")) --- 387,391 ---- case 'u': { ! int version = 2; if (!strcmp(optarg,"3.0") || !strcmp(optarg,"30")) *************** *** 349,353 **** } ! InitNibbleMem(512, 512); fd = open_ilmi(itf,qos); ilmi_loop(fd, itf); --- 429,440 ---- } ! InitNibbleMem(1024, 512); ! memset( remsys, 0, sizeof( _remsys )); ! memset( apoint, 0, sizeof( _apoint )); ! memset( newapoint, 0, sizeof( _newapoint )); ! signal( SIGTERM, handler ); ! signal( SIGKILL, handler ); ! signal( SIGINT, handler ); ! signal( SIGSTOP, handler ); fd = open_ilmi(itf,qos); ilmi_loop(fd, itf); Index: io.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/io.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** io.c 9 Oct 2001 22:33:06 -0000 1.2 --- io.c 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 26,29 **** --- 26,30 ---- #endif + #include <unistd.h> #include <sys/socket.h> #include <netinet/in.h> *************** *** 33,36 **** --- 34,38 ---- #include <atm.h> #include <linux/atmdev.h> + #include "ilmid.h" #include "io.h" #include "atmd.h" *************** *** 43,46 **** --- 45,50 ---- registered the "official" address) - HACK */ + extern SysGroup *remsys; + extern State ilmi_state; static short atm_itf = -1; /* bad value */ *************** *** 177,182 **** FD_SET(fd, &fdvar); ! if((numfds = select(fd + 1, &fdvar, 0, 0, timeout)) < 0) diag(COMPONENT, DIAG_FATAL, "select: %s", strerror(errno)); return numfds; --- 181,188 ---- FD_SET(fd, &fdvar); ! if((numfds = select(fd + 1, &fdvar, 0, 0, timeout)) < 0){ ! if( errno != EINTR ) diag(COMPONENT, DIAG_FATAL, "select: %s", strerror(errno)); + } return numfds; *************** *** 300,302 **** --- 306,309 ---- return error; } + return 0; } Index: io.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/io.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** io.h 9 Oct 2001 22:33:06 -0000 1.2 --- io.h 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 28,31 **** --- 28,32 ---- #include <atm.h> #include <linux/atmdev.h> + #include "ilmid.h" #include "asn_incl.h" #include "rfc1155_smi.h" Index: message.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/message.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** message.c 9 Oct 2001 22:33:06 -0000 1.2 --- message.c 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 28,39 **** #endif #include "message.h" #include "atmf_uni.h" #include "util.h" int no_var_bindings = 0; ! AsnOid atmAddressStatus = {ADDRESS_LEN, ADDRESS_OID}; Message *create_poll_message(void) { --- 28,129 ---- #endif + #include <unistd.h> + #include <stdarg.h> + #include "message.h" #include "atmf_uni.h" #include "util.h" + #include "sysgroup.h" int no_var_bindings = 0; ! // AsnOid atmAddressStatus = {ADDRESS_LEN, ADDRESS_OID}; ! ! Message *create_va_getnext_message( int n, ... ){ ! Message *m = alloc_t( Message ); ! VarBind *entry; ! AsnOid *what; ! va_list ap; ! int count; + if( m == NULL ) return NULL; + m->version = VERSION_1; + m->community.octs = "ILMI"; + m->community.octetLen = 4; + m->data = alloc_t( PDUs ); + m->data->choiceId = PDUS_GET_NEXT_REQUEST; + m->data->a.get_next_request = alloc_t( GetRequest_PDU ); + m->data->a.get_next_request->error_status = 0; + m->data->a.get_next_request->error_index = 0; + m->data->a.get_next_request->variable_bindings = alloc_t( VarBindList ); + AsnListInit( m->data->a.get_next_request->variable_bindings, + sizeof( VarBind )); + va_start( ap, n ); + count = 0; + while( count < n ){ + what = va_arg( ap, AsnOid* ); + entry = AppendVarBind( + m->data->a.get_next_request->variable_bindings ); + entry->name.octs = alloc( what->octetLen ); + entry->name.octetLen = what->octetLen; + memcpy( entry->name.octs, what->octs, what->octetLen ); + entry->value = alloc_t( ObjectSyntax ); + entry->value->choiceId = OBJECTSYNTAX_SIMPLE; + entry->value->a.simple = alloc_t( SimpleSyntax ); + entry->value->a.simple->choiceId = SIMPLESYNTAX_NUMBER; + count++; + } + va_end(ap); + return m; + } + + Message *create_va_get_message( int n, ... ){ + Message *m = alloc_t( Message ); + VarBind *entry; + AsnOid *what; + va_list ap; + int count; + + if( m == NULL ) return NULL; + m->version = VERSION_1; + m->community.octs = "ILMI"; + m->community.octetLen = 4; + m->data = alloc_t( PDUs ); + m->data->choiceId = PDUS_GET_REQUEST; + m->data->a.get_request = alloc_t( GetRequest_PDU ); + m->data->a.get_request->error_status = 0; + m->data->a.get_request->error_index = 0; + m->data->a.get_request->variable_bindings = alloc_t( VarBindList ); + AsnListInit( m->data->a.get_request->variable_bindings, + sizeof( VarBind )); + va_start( ap, n ); + count = 0; + while( count < n ){ + what = va_arg( ap, AsnOid* ); + entry = AppendVarBind( + m->data->a.get_request->variable_bindings ); + entry->name.octs = alloc( what->octetLen ); + entry->name.octetLen = what->octetLen; + memcpy( entry->name.octs, what->octs, what->octetLen ); + entry->value = alloc_t( ObjectSyntax ); + entry->value->choiceId = OBJECTSYNTAX_SIMPLE; + entry->value->a.simple = alloc_t( SimpleSyntax ); + entry->value->a.simple->choiceId = SIMPLESYNTAX_NUMBER; + count++; + } + va_end(ap); + return m; + } + + + Message *create_get_message( AsnOid what ){ + return create_va_get_message( 1, &what ); + } + + Message *create_getnext_message( AsnOid what ){ + return create_va_getnext_message( 1, &what ); + } + + #ifdef notdef Message *create_poll_message(void) { *************** *** 65,68 **** --- 155,159 ---- return poll_message; } + #endif Message *create_set_message(void) Index: message.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/message.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** message.h 9 Oct 2001 22:33:06 -0000 1.2 --- message.h 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 34,42 **** extern int no_var_bindings; ! AsnOid atmAddressStatus; Message *create_poll_message(void); Message *create_set_message(void); Message *create_coldstart_message(void); #endif --- 34,47 ---- extern int no_var_bindings; ! //AsnOid atmAddressStatus; Message *create_poll_message(void); Message *create_set_message(void); Message *create_coldstart_message(void); + Message *create_va_getnext_message( int, ... ); + Message *create_va_get_message( int, ... ); + Message *create_getnext_message( AsnOid ); + Message *create_get_message( AsnOid ); + void free_message( Message *m ); #endif Index: mib.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/mib.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** mib.c 9 Oct 2001 22:33:06 -0000 1.2 --- mib.c 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 47,50 **** --- 47,53 ---- { &sysLocation, getString, NULL, NULL, &sysLocationValue }, { &sysServices, getInteger, NULL, NULL, &sysServicesValue }, + { &foreQ2931AdminConfigType, getInteger, NULL, NULL, + &foreQ2931AdminConfigTypeValue }, + { &foreQ2931NNIProto, getInteger, NULL, NULL, &foreQ2931NNIProtoValue }, { &atmfPortIndex, getInteger, NULL, NULL, &atmfPortIndexValue }, { &atmfPortMyIdentifier, getInteger, NULL, NULL, &atmfPortIndexValue }, *************** *** 53,63 **** { &atmfAtmLayerMaxVpiBits, getVpiRange, NULL, NULL, &atmfAtmLayerMaxVpiBitsValue }, { &atmfAtmLayerMaxVciBits, getVciRange, NULL, NULL, &atmfAtmLayerMaxVciBitsValue }, { &atmfAtmLayerUniVersion, getInteger, NULL, NULL, &atmfAtmLayerUniVersionValue }, { &atmfNetPrefixStatus, getNetPrefix, getnextNetPrefix, setNetPrefix, NULL }, { NULL } }; ! void MIBget(VarBindList *list, PDUInt *status, AsnInt *index) { VarBind *varbind; --- 56,75 ---- { &atmfAtmLayerMaxVpiBits, getVpiRange, NULL, NULL, &atmfAtmLayerMaxVpiBitsValue }, { &atmfAtmLayerMaxVciBits, getVciRange, NULL, NULL, &atmfAtmLayerMaxVciBitsValue }, + { &atmfAtmLayerUniType, getInteger, NULL, NULL, &atmfAtmLayerUniTypeValue}, { &atmfAtmLayerUniVersion, getInteger, NULL, NULL, &atmfAtmLayerUniVersionValue }, + { &atmfAtmLayerDeviceType, getInteger, NULL, NULL, + &atmfAtmLayerDeviceTypeValue}, + { &atmfAtmLayerIlmiVersion, getInteger, NULL, NULL, + &atmfAtmLayerIlmiVersionValue}, + { &atmfAtmLayerNniSigVersion, getInteger, NULL, NULL, + &atmfAtmLayerNniSigVersionValue}, { &atmfNetPrefixStatus, getNetPrefix, getnextNetPrefix, setNetPrefix, NULL }, { NULL } }; ! ! ! void MIBget(VarBindList *list, PDUInt *status, AsnInt *offset) { VarBind *varbind; *************** *** 65,69 **** AsnOidResult result; ! *index = 1; FOR_EACH_LIST_ELMT(varbind, list) { --- 77,81 ---- AsnOidResult result; ! *offset = 1; FOR_EACH_LIST_ELMT(varbind, list) { *************** *** 92,103 **** return; ! (*index)++; } ! *index = 0; return; } ! void MIBgetnext(VarBindList *list, PDUInt *status, AsnInt *index) { VarBind *varbind; --- 104,115 ---- return; ! (*offset)++; } ! *offset = 0; return; } ! void MIBgetnext(VarBindList *list, PDUInt *status, AsnInt *offset) { VarBind *varbind; *************** *** 105,109 **** AsnOidResult result; ! *index = 1; FOR_EACH_LIST_ELMT(varbind, list) { --- 117,121 ---- AsnOidResult result; ! *offset = 1; FOR_EACH_LIST_ELMT(varbind, list) { *************** *** 140,150 **** return; ! (*index)++; } ! *index = 0; return; } ! void MIBset(VarBindList *list, PDUInt *status, AsnInt *index) { VarBind *varbind; --- 152,162 ---- return; ! (*offset)++; } ! *offset = 0; return; } ! void MIBset(VarBindList *list, PDUInt *status, AsnInt *offset) { VarBind *varbind; *************** *** 152,156 **** AsnOidResult result; ! *index = 1; FOR_EACH_LIST_ELMT(varbind, list) { --- 164,168 ---- AsnOidResult result; ! *offset = 1; FOR_EACH_LIST_ELMT(varbind, list) { *************** *** 183,189 **** return; ! (*index)++; } ! *index = 0; return; } --- 195,201 ---- return; ! (*offset)++; } ! *offset = 0; return; } *************** *** 245,249 **** return NOERROR; } - #include <stdint.h> --- 257,260 ---- Index: mib.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/mib.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** mib.h 9 Oct 2001 22:33:06 -0000 1.2 --- mib.h 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 40,46 **** } Variable; ! void MIBget(VarBindList *list, PDUInt *status, AsnInt *index); ! void MIBgetnext(VarBindList *list, PDUInt *status, AsnInt *index); ! void MIBset(VarBindList *list, PDUInt *status, AsnInt *index); void *MIBdelete(AsnOid *oid); --- 40,46 ---- } Variable; ! void MIBget(VarBindList *list, PDUInt *status, AsnInt *offset); ! void MIBgetnext(VarBindList *list, PDUInt *status, AsnInt *offset); ! void MIBset(VarBindList *list, PDUInt *status, AsnInt *offset); void *MIBdelete(AsnOid *oid); |
From: chas w. <ch...@us...> - 2003-07-19 21:07:22
|
Update of /cvsroot/linux-atm/linux-atm/src/ilmid/asn1 In directory sc8-pr-cvs1:/tmp/cvs-serv29312/asn1 Modified Files: Tag: V2_5_0 asn_config.h Log Message: ilmi updates from ek...@cm... Index: asn_config.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/asn1/asn_config.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** asn_config.h 9 Oct 2001 22:33:06 -0000 1.2 --- asn_config.h 19 Jul 2003 21:07:19 -0000 1.2.2.1 *************** *** 24,27 **** --- 24,29 ---- #include <ctype.h> /* for isprint() in asn_octs.c */ #include <setjmp.h> /* for jmp_buf type, setjmp and longjmp */ + #include <string.h> /* memcpy, etc */ + #include <stdlib.h> /* for free */ /* for pow() used in asn_real.c - must include to avoid casting err on pow */ |
From: chas w. <ch...@us...> - 2003-07-16 01:24:50
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1:/tmp/cvs-serv16379 Modified Files: Tag: V2_5_0 conn.c Log Message: better choice for backlogged connections Index: conn.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/conn.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 *** conn.c 2 May 2003 16:39:36 -0000 1.2.2.1 --- conn.c 16 Jul 2003 01:24:47 -0000 1.2.2.2 *************** *** 375,379 **** if (fd < 0) return NULL; ! ret = listen(fd, 5); if (ret != 0) { diag(COMPONENT, DIAG_DEBUG, "Listen failed: %s\n", strerror(errno)); --- 375,379 ---- if (fd < 0) return NULL; ! ret = listen(fd, 16); if (ret != 0) { diag(COMPONENT, DIAG_DEBUG, "Listen failed: %s\n", strerror(errno)); |
From: chas w. <ch...@us...> - 2003-05-02 19:26:11
|
Update of /cvsroot/linux-atm/linux-atm/src/ilmid/asn1 In directory sc8-pr-cvs1:/tmp/cvs-serv13072/asn1 Modified Files: Tag: V2_5_0 nibble_alloc.h Log Message: make this a valid prototype so the compiler doesnt complain Index: nibble_alloc.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/asn1/nibble_alloc.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** nibble_alloc.h 9 Oct 2001 22:33:06 -0000 1.2 --- nibble_alloc.h 2 May 2003 19:26:06 -0000 1.2.2.1 *************** *** 40,44 **** unsigned long int incrementSize)); ! void ShutdownNibbleMem(); void ServiceNibbleFault PROTO((unsigned long int size)); --- 40,44 ---- unsigned long int incrementSize)); ! void ShutdownNibbleMem(void); void ServiceNibbleFault PROTO((unsigned long int size)); *************** *** 46,50 **** void* NibbleAlloc PROTO((unsigned long int size)); ! void ResetNibbleMem(); --- 46,50 ---- void* NibbleAlloc PROTO((unsigned long int size)); ! void ResetNibbleMem(void); |
From: chas w. <ch...@us...> - 2003-05-02 17:47:36
|
Update of /cvsroot/linux-atm/linux-atm/src/qgen In directory sc8-pr-cvs1:/tmp/cvs-serv15054 Modified Files: Tag: V2_5_0 uni.h Log Message: ATM_TDL_NGI should be 0xa not 0x6 -- see the uni 4.0 specification Index: uni.h =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/qgen/uni.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** uni.h 9 Oct 2001 22:33:07 -0000 1.2 --- uni.h 2 May 2003 17:47:32 -0000 1.2.2.1 *************** *** 395,399 **** #define ATM_TDL_CUM 0x01 /* Cumulative transit delay value */ #define ATM_TDL_E2EMAX 0x03 /* Maximum end-to-end transit delay value*/ ! #define ATM_TDL_NGI 0x06 /* Network generated indicator */ /* Transit network identification */ --- 395,399 ---- #define ATM_TDL_CUM 0x01 /* Cumulative transit delay value */ #define ATM_TDL_E2EMAX 0x03 /* Maximum end-to-end transit delay value*/ ! #define ATM_TDL_NGI 0x0a /* Network generated indicator */ /* Transit network identification */ |
From: chas w. <ch...@us...> - 2003-05-02 17:35:09
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1:/tmp/cvs-serv7193 Modified Files: Tag: V2_5_0 main.c zeppelin.8 Log Message: zeppelin will now create a file during startup in /var/run called lec[interface number].pid containing its pid. this makes it easier to find a kill a particular interface via a script Index: main.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/main.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 *** main.c 2 May 2003 17:19:41 -0000 1.2.2.1 --- main.c 2 May 2003 17:35:03 -0000 1.2.2.2 *************** *** 41,44 **** --- 41,45 ---- #include <getopt.h> #include <errno.h> + #include <fcntl.h> #include <atm.h> *************** *** 202,205 **** --- 203,208 ---- struct sockaddr_atmsvc manual_atm_addr; struct sockaddr_atmsvc listen_addr; + char pidbuf[PATH_MAX + 1]; + int fd; memset(elan_name, '\0', sizeof(elan_name)); *************** *** 413,416 **** --- 416,429 ---- } } + + 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\n", pidbuf, strerror(errno)); + return -1; + } + sprintf(pidbuf, "%d\n", getpid()); + write(fd, pidbuf, strlen(pidbuf)); + close(fd); diag(COMPONENT, DIAG_DEBUG, "initializing lec parameters\n"); Index: zeppelin.8 =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/zeppelin.8,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** zeppelin.8 2 May 2003 17:23:19 -0000 1.2.2.1 --- zeppelin.8 2 May 2003 17:35:04 -0000 1.2.2.2 *************** *** 99,102 **** --- 99,105 ---- recommended. Token Ring support has received less testing than its Ethernet counterpart. + .SH FILES + .IP \fI/var/run/lec[interface number].pid\fP + The file containing the process id of zeppelin. .SH BUGS John Bonham died 1980 and Led Zeppelin broke. |
From: chas w. <ch...@us...> - 2003-05-02 17:23:26
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1:/tmp/cvs-serv32417 Modified Files: Tag: V2_5_0 zeppelin.8 Log Message: document -b option Index: zeppelin.8 =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/zeppelin.8,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** zeppelin.8 9 Oct 2001 22:33:07 -0000 1.2 --- zeppelin.8 2 May 2003 17:23:19 -0000 1.2.2.1 *************** *** 4,7 **** --- 4,8 ---- .SH SYNOPSIS .B zeppelin + .RB [ \-b\ ] .RB [ \-c\ \fILECS_address\fP\ |\ \-s\ \fILES_address\fP ] .RB [ \-e\ \fIesi\fP ] *************** *** 36,39 **** --- 37,43 ---- released and \fBzeppelin\fP is started. .SH OPTIONS + .IP \fB\-b\fP + Run in background (i.e. in a forked child process) after initializing + kernel interface. .IP \fB\-c\ \fILECS_address\fP ATM address of \fBlecs(8)\fP (Lan Emulation Configuration Server), if not |
From: chas w. <ch...@us...> - 2003-05-02 17:19:44
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1:/tmp/cvs-serv29666 Modified Files: Tag: V2_5_0 main.c Log Message: add -b (daemon flag) option -- this should make startup scripts somewhat easier to write. the lec interface will be before the zeppelin forks the child so you no longer need to sleep after starting zeppelin before configuring the interface Index: main.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/main.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** main.c 9 Oct 2001 22:33:07 -0000 1.2 --- main.c 2 May 2003 17:19:41 -0000 1.2.2.1 *************** *** 198,201 **** --- 198,203 ---- int lecs_method = LECS_WELLKNOWN; int poll_ret = 0, itf = 0, phys_itf = 0, selector = 0; + int daemon_flag = 0; + pid_t pid; struct sockaddr_atmsvc manual_atm_addr; struct sockaddr_atmsvc listen_addr; *************** *** 211,216 **** while(poll_ret != -1) { ! poll_ret = getopt(argc, argv, "c:e:n:s:m:l:i:I:q:12pf:t:F:"); switch(poll_ret) { case 'c': if (atm_set) { --- 213,221 ---- while(poll_ret != -1) { ! poll_ret = getopt(argc, argv, "bc:e:n:s:m:l:i:I:q:12pf:t:F:"); switch(poll_ret) { + case 'b': + daemon_flag = 1; + break; case 'c': if (atm_set) { *************** *** 389,392 **** --- 394,416 ---- return -1; } + + if (daemon_flag == 1) { + daemon_flag = 0; + pid = fork(); + if (pid < 0) { + diag(COMPONENT, DIAG_FATAL, "fork failed, exiting...\n"); + return -1; + } + if (pid) { + /* parent */ + return 0; + } else { + /* child */ + if (setsid() < 0) { + diag(COMPONENT, DIAG_FATAL, "setsid failed, exiting...\n"); + return -1; + } + } + } diag(COMPONENT, DIAG_DEBUG, "initializing lec parameters\n"); |
From: chas w. <ch...@us...> - 2003-05-02 16:39:40
|
Update of /cvsroot/linux-atm/linux-atm/src/led In directory sc8-pr-cvs1:/tmp/cvs-serv28789 Modified Files: Tag: V2_5_0 conn.c frames.c Log Message: handle_connect() now checks the incoming call's atm address. if its not the default data direct and a call already exists the connection is closed (it no longer assumes that this call is going to be the default data direct) handle_accept() checks the incoming call to see if it should be the default data direct. if not, the connection is attached as a receive only. if this would be the default data direct, the it gets attached as such and the old data direct (which zeppelin probably setup) is closed. since zeppelin may not setup the connection to a client, it needs to watch for the READY_IND on connections and upon recept, send a flush request to switch over to the new path. Index: conn.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/conn.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** conn.c 9 Oct 2001 22:33:07 -0000 1.2 --- conn.c 2 May 2003 16:39:36 -0000 1.2.2.1 *************** *** 38,41 **** --- 38,42 ---- #include <errno.h> #include <sys/ioctl.h> + #include <time.h> #include <atm.h> *************** *** 224,236 **** - /* - * You need to check this if setup_svc() returns NULL - */ - #if 0 - if (is_data_direct(&sap->blli[0])) { - /* Try to remove possible entry in kernel */ - delete_addr(conn->atm_address); - } - #endif /* Does an active open to dst_addr using pre-filled * parameters in sap and qos. --- 225,228 ---- *************** *** 249,268 **** diag(COMPONENT, DIAG_DEBUG, "Outgoing call setup\n"); - /* The code below is commented out due to the following scenario: - We have made a connection to another LEC and our address was - numerically lower than theirs (LANEv2 8.1.13). - The other end has also connected us, but we must not use that - VCC. - However, if the connection we made gets closed, we can not open - it again since a connection to the destination LEC already exists. - */ - #if 0 - /* We don't create connection to an entity where we already have - a connection. */ - if (conn_already_exists(dst_addr->sas_addr.prv, NULL) && - is_data_direct(&sap->blli[0])) - return NULL; - #endif - dst_addr->sas_family = AF_ATMSVC; listen_addr->sas_family = AF_ATMSVC; --- 241,244 ---- *************** *** 518,522 **** static int handle_accept(Conn_t *conn) { ! Conn_t *new; struct atmlec_ioc ioc; --- 494,498 ---- static int handle_accept(Conn_t *conn) { ! Conn_t *new, *existing = NULL; struct atmlec_ioc ioc; *************** *** 530,538 **** diag(COMPONENT, DIAG_DEBUG, "Data Direct VCC accepted\n"); ioc.receive = 0; ! if (conn_already_exists(new->atm_address, new) && ! memcmp(lec_params.c1n_my_atm_addr, new->atm_address, ATM_ESA_LEN) < 0) { ! diag(COMPONENT, DIAG_DEBUG, "Using it only to receive, spec 8.1.1\n"); ! ioc.receive = 1; ! } } memcpy(ioc.atm_addr, new->atm_address, ATM_ESA_LEN); --- 506,516 ---- 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; ! } } memcpy(ioc.atm_addr, new->atm_address, ATM_ESA_LEN); *************** *** 544,547 **** --- 522,530 ---- } + if (existing && existing->status == CONNECTED) { + diag(COMPONENT, DIAG_DEBUG, "Closing old data direct, fd %d\n", existing->fd); + close_connection(existing); + } + return 0; } *************** *** 633,646 **** } - send_ready_ind(conn); - memcpy(ioc.atm_addr, conn->atm_address, ATM_ESA_LEN); ioc.dev_num = lec_params.itf_num; ioc.receive = 0; diag(COMPONENT, DIAG_DEBUG, "Attaching a new active VCC, fd %d\n", conn->fd); if (ioctl(conn->fd, ATMLEC_DATA, &ioc) < 0) { diag(COMPONENT, DIAG_ERROR, "VCC attach failed: ioctl: %s\n", strerror(errno)); return -1; } memset(&msg, 0, sizeof(struct atmlec_msg)); --- 616,636 ---- } memcpy(ioc.atm_addr, conn->atm_address, ATM_ESA_LEN); ioc.dev_num = lec_params.itf_num; ioc.receive = 0; diag(COMPONENT, DIAG_DEBUG, "Attaching a new active VCC, fd %d\n", conn->fd); + if (conn_already_exists(conn->atm_address, conn) && + /* is calling address > called address */ + memcmp(lec_params.c1n_my_atm_addr, conn->atm_address, ATM_ESA_LEN) > 0) { + diag(COMPONENT, DIAG_DEBUG, "Receive only, spec 8.1.13 -- Closing"); + close_connection(conn); + return 0; + } if (ioctl(conn->fd, ATMLEC_DATA, &ioc) < 0) { diag(COMPONENT, DIAG_ERROR, "VCC attach failed: ioctl: %s\n", strerror(errno)); return -1; } + + send_ready_ind(conn); memset(&msg, 0, sizeof(struct atmlec_msg)); Index: frames.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/led/frames.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** frames.c 9 Oct 2001 22:33:07 -0000 1.2 --- frames.c 2 May 2003 16:39:36 -0000 1.2.2.1 *************** *** 294,297 **** --- 294,312 ---- } + static void handle_ready_ind(Conn_t *conn) + { + struct atmlec_msg msg; + + /* FIXME -- if its a receive only vcc we should not do this */ + + diag(COMPONENT, DIAG_DEBUG, "READY_IND, on fd %d; sending LE_FLUSH_REQ\n", conn->fd); + memset(&msg, 0, sizeof(struct atmlec_msg)); + msg.type = l_flush_tran_id; + memcpy(msg.content.normal.atm_addr, conn->atm_address, ATM_ESA_LEN); + msg.content.normal.flag = send_flush_req(conn); + + msg_to_kernel(&msg, sizeof(struct atmlec_msg)); + } + /* Processes and validates incoming frames. Calls frame * dependant handler functions. *************** *** 312,315 **** --- 327,331 ---- break; case LE_FLUSH_RSP: + diag(COMPONENT, DIAG_DEBUG, "LE_FLUSH_RESPONSE, on fd %d", conn->fd); handle_flush_rsp(frame); break; *************** *** 318,322 **** break; case READY_IND: ! /* We can ignore these */ break; case LE_ARP_REQ: --- 334,338 ---- break; case READY_IND: ! handle_ready_ind(conn); break; case LE_ARP_REQ: |
From: chas w. <ch...@us...> - 2003-05-02 13:47:49
|
Update of /cvsroot/linux-atm/linux-atm/src/switch/debug In directory sc8-pr-cvs1:/tmp/cvs-serv3121a/src/switch/debug Modified Files: Tag: V2_5_0 Makefile.am Log Message: use srcdir instead of top_builddir -- this lets you build the sources outside the source tree Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/switch/debug/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Makefile.am 9 Oct 2001 22:33:08 -0000 1.2 --- Makefile.am 2 May 2003 13:47:13 -0000 1.2.2.1 *************** *** 1,5 **** noinst_PROGRAMS = sw_debug ! INCLUDES = -I$(top_builddir)/src/qgen sw_debug_SOURCES = debug.c --- 1,5 ---- noinst_PROGRAMS = sw_debug ! INCLUDES = -I$(srcdir)/../../qgen sw_debug_SOURCES = debug.c |
From: chas w. <ch...@us...> - 2003-05-02 13:47:48
|
Update of /cvsroot/linux-atm/linux-atm/src/switch/tcp In directory sc8-pr-cvs1:/tmp/cvs-serv3121a/src/switch/tcp Modified Files: Tag: V2_5_0 Makefile.am Log Message: use srcdir instead of top_builddir -- this lets you build the sources outside the source tree Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/switch/tcp/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Makefile.am 9 Oct 2001 22:33:08 -0000 1.2 --- Makefile.am 2 May 2003 13:47:13 -0000 1.2.2.1 *************** *** 1,5 **** noinst_PROGRAMS = sw_tcp ! INCLUDES = -I$(top_builddir)/src/qgen sw_tcp_SOURCES = tcpsw.c --- 1,5 ---- noinst_PROGRAMS = sw_tcp ! INCLUDES = -I$(srcdir)/../../qgen sw_tcp_SOURCES = tcpsw.c |
From: chas w. <ch...@us...> - 2003-05-02 13:47:48
|
Update of /cvsroot/linux-atm/linux-atm/src/test In directory sc8-pr-cvs1:/tmp/cvs-serv3121a/src/test Modified Files: Tag: V2_5_0 Makefile.am Log Message: use srcdir instead of top_builddir -- this lets you build the sources outside the source tree Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/test/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Makefile.am 9 Oct 2001 22:33:08 -0000 1.2 --- Makefile.am 2 May 2003 13:47:13 -0000 1.2.2.1 *************** *** 27,31 **** errnos.inc: mkerrnos.pl ! @PERL@ ./mkerrnos.pl </usr/include/asm/errno.h \ >errnos.inc || { rm -f errnos.inc; exit 1; } --- 27,31 ---- errnos.inc: mkerrnos.pl ! @PERL@ $(srcdir)/mkerrnos.pl </usr/include/asm/errno.h \ >errnos.inc || { rm -f errnos.inc; exit 1; } |
From: chas w. <ch...@us...> - 2003-05-02 13:47:21
|
Update of /cvsroot/linux-atm/linux-atm/src/ilmid In directory sc8-pr-cvs1:/tmp/cvs-serv3121a/src/ilmid Modified Files: Tag: V2_5_0 Makefile.am Log Message: use srcdir instead of top_builddir -- this lets you build the sources outside the source tree Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/ilmid/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Makefile.am 9 Oct 2001 22:33:06 -0000 1.2 --- Makefile.am 2 May 2003 13:47:16 -0000 1.2.2.1 *************** *** 1,5 **** SUBDIRS = asn1 ! INCLUDES = -I$(top_builddir)/src/ilmid/asn1 sbin_PROGRAMS = ilmid --- 1,5 ---- SUBDIRS = asn1 ! INCLUDES = -I$(srcdir)/../ilmid/asn1 sbin_PROGRAMS = ilmid |
From: chas w. <ch...@us...> - 2003-05-02 13:47:20
|
Update of /cvsroot/linux-atm/linux-atm/src/maint In directory sc8-pr-cvs1:/tmp/cvs-serv3121a/src/maint Modified Files: Tag: V2_5_0 Makefile.am Log Message: use srcdir instead of top_builddir -- this lets you build the sources outside the source tree Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/maint/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Makefile.am 9 Oct 2001 22:33:07 -0000 1.2 --- Makefile.am 2 May 2003 13:47:15 -0000 1.2.2.1 *************** *** 3,7 **** USRPGMS=atmdiag atmdump sonetdiag saaldump ! INCLUDES=-I$(top_builddir)/src/qgen -I$(top_builddir)/src/saal -I. LDADD = $(top_builddir)/src/lib/libatm.la --- 3,7 ---- USRPGMS=atmdiag atmdump sonetdiag saaldump ! INCLUDES=-I$(srcdir)/../qgen -I$(srcdir)/../saal -I. LDADD = $(top_builddir)/src/lib/libatm.la |
From: chas w. <ch...@us...> - 2003-05-02 13:47:20
|
Update of /cvsroot/linux-atm/linux-atm/src/qgen In directory sc8-pr-cvs1:/tmp/cvs-serv3121a/src/qgen Modified Files: Tag: V2_5_0 Makefile.am Log Message: use srcdir instead of top_builddir -- this lets you build the sources outside the source tree Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/qgen/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Makefile.am 9 Oct 2001 22:33:07 -0000 1.2 --- Makefile.am 2 May 2003 13:47:15 -0000 1.2.2.1 *************** *** 31,43 **** atm_it atm_lit atm_lsi atm_tcs atm_css atm_eqo atm_eqp atm_aap \ atm_asp atm_tor ! SYMFILES = uni.h $(shell @PERL@ incl.pl $(CFLAGS) linux/atmsap.h) default.nl: mknl.pl $(SYMFILES) ! cat $(SYMFILES) | @PERL@ mknl.pl $(NLS) >default.nl || \ { rm -f default.nl; echo 1; } q.out.h q.out.c q.test.c: qgen msg.fmt default.nl ! $(CPP) $(DEFS) - <msg.fmt | ./qgen #q40.out.h q40.out.c q40.test.c: qgen uni40 default.nl --- 31,43 ---- atm_it atm_lit atm_lsi atm_tcs atm_css atm_eqo atm_eqp atm_aap \ atm_asp atm_tor ! SYMFILES = $(srcdir)/uni.h $(shell @PERL@ $(srcdir)/incl.pl $(CFLAGS) linux/atmsap.h) default.nl: mknl.pl $(SYMFILES) ! cat $(SYMFILES) | @PERL@ $(srcdir)/mknl.pl $(NLS) >default.nl || \ { rm -f default.nl; echo 1; } 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 *************** *** 45,49 **** qd.out.h qd.out.c qd.dump.c: qgen msg.fmt default.nl ! $(CPP) $(DEFS) - <msg.fmt | ./qgen -D q.out.o: q.out.c q.out.h qlib.c qlib.h --- 45,49 ---- 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 |
From: chas w. <ch...@us...> - 2003-05-02 13:47:19
|
Update of /cvsroot/linux-atm/linux-atm/src/sigd In directory sc8-pr-cvs1:/tmp/cvs-serv3121a/src/sigd Modified Files: Tag: V2_5_0 Makefile.am Log Message: use srcdir instead of top_builddir -- this lets you build the sources outside the source tree Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/sigd/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Makefile.am 9 Oct 2001 22:33:07 -0000 1.2 --- Makefile.am 2 May 2003 13:47:14 -0000 1.2.2.1 *************** *** 1,3 **** ! INCLUDES = -I$(top_builddir)/src/qgen -I$(top_builddir)/src/saal -I. sbin_PROGRAMS = atmsigd --- 1,3 ---- ! INCLUDES = -I$(top_builddir)/src/qgen -I$(srcdir)/../qgen -I$(srcdir)/../saal -I. sbin_PROGRAMS = atmsigd *************** *** 20,23 **** mess.c: $(top_builddir)/src/qgen/uni.h mkmess.pl ! @PERL@ ./mkmess.pl <$(top_builddir)/src/qgen/uni.h >mess.c --- 20,23 ---- mess.c: $(top_builddir)/src/qgen/uni.h mkmess.pl ! @PERL@ $(srcdir)/mkmess.pl <$(srcdir)/../qgen/uni.h >mess.c |
From: chas w. <ch...@us...> - 2003-05-01 13:24:01
|
Update of /cvsroot/linux-atm/linux-atm In directory sc8-pr-cvs1:/tmp/cvs-serv19778 Modified Files: Tag: V2_5_0 configure.in Log Message: change version of 2.5.0 Index: configure.in =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/configure.in,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** configure.in 15 Oct 2001 23:19:42 -0000 1.2.2.1 --- configure.in 1 May 2003 13:23:57 -0000 1.2.2.2 *************** *** 12,16 **** AC_CANONICAL_SYSTEM ! AM_INIT_AUTOMAKE(linux-atm,2.4.0) LIBVER_CURRENT="1" --- 12,16 ---- AC_CANONICAL_SYSTEM ! AM_INIT_AUTOMAKE(linux-atm,2.5.0) LIBVER_CURRENT="1" |
From: chas w. <ch...@us...> - 2003-05-01 13:23:24
|
Update of /cvsroot/linux-atm/linux-atm/src/lane In directory sc8-pr-cvs1:/tmp/cvs-serv19559/src/lane Modified Files: Tag: V2_5_0 dump.c Log Message: import vsprintf changes from 2.4.1 Index: dump.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/lane/dump.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** dump.c 9 Oct 2001 22:33:06 -0000 1.2 --- dump.c 1 May 2003 13:23:19 -0000 1.2.2.1 *************** *** 186,190 **** case DT_FILE: va_start(args, format); ! printf_ret = vsprintf(buffer, format, args); assert(printf_ret > 0); printf_ret = fprintf(dump_filep, "%s%s%s", el_prefix[level], buffer, --- 186,190 ---- case DT_FILE: va_start(args, format); ! printf_ret = vsnprintf(buffer, BUFSIZE, format, args); assert(printf_ret > 0); printf_ret = fprintf(dump_filep, "%s%s%s", el_prefix[level], buffer, *************** *** 197,201 **** case DT_SYSLOG: va_start(args, format); ! printf_ret = vsprintf(buffer, format, args); assert(printf_ret > 0); syslog(el_to_log[level], "%s", buffer); --- 197,201 ---- case DT_SYSLOG: va_start(args, format); ! printf_ret = vsnprintf(buffer, BUFSIZE, format, args); assert(printf_ret > 0); syslog(el_to_log[level], "%s", buffer); *************** *** 221,225 **** va_start(args, format); ! sprintf_ret = vsprintf(buffer2, buffer, args); assert(sprintf_ret > 0); va_end(args); --- 221,225 ---- va_start(args, format); ! sprintf_ret = vsnprintf(buffer2, 2048, buffer, args); assert(sprintf_ret > 0); va_end(args); |
From: chas w. <ch...@us...> - 2003-05-01 13:23:22
|
Update of /cvsroot/linux-atm/linux-atm/src/lib In directory sc8-pr-cvs1:/tmp/cvs-serv19559/src/lib Modified Files: Tag: V2_5_0 diag.c sap2text.c Log Message: import vsprintf changes from 2.4.1 Index: diag.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/lib/diag.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** diag.c 9 Oct 2001 22:33:07 -0000 1.2 --- diag.c 1 May 2003 13:23:18 -0000 1.2.2.1 *************** *** 136,140 **** if (!to) { for (i = 0; sev2prio[i] == severity || sev2prio[i] == -1; i += 2); ! vsprintf(buffer,fmt,ap); syslog(sev2prio[i+1],"%s: %s",component,buffer); } --- 136,140 ---- if (!to) { for (i = 0; sev2prio[i] == severity || sev2prio[i] == -1; i += 2); ! vsnprintf(buffer,MAX_DIAG_MSG+1,fmt,ap); syslog(sev2prio[i+1],"%s: %s",component,buffer); } Index: sap2text.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/lib/sap2text.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** sap2text.c 9 Oct 2001 22:33:07 -0000 1.2 --- sap2text.c 1 May 2003 13:23:18 -0000 1.2.2.1 *************** *** 42,46 **** va_start(ap,fmt); ! len = vsprintf(scratch,fmt,ap); va_end(ap); if (!len) return 0; --- 42,46 ---- va_start(ap,fmt); ! len = vsnprintf(scratch,40,fmt,ap); va_end(ap); if (!len) return 0; |