Update of /cvsroot/linux-atm/linux-atm/src/br2684
In directory sc8-pr-cvs1:/tmp/cvs-serv15084
Modified Files:
Tag: V2_5_0
br2684ctl.c
Log Message:
qos support from Adam Kaczynski <ka...@dg...>
Index: br2684ctl.c
===================================================================
RCS file: /cvsroot/linux-atm/linux-atm/src/br2684/Attic/br2684ctl.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** br2684ctl.c 19 Jul 2003 22:03:28 -0000 1.1.2.1
--- br2684ctl.c 19 Jul 2003 22:24:51 -0000 1.1.2.2
***************
*** 79,86 ****
! int assign_vcc(char *astr, int encap, int bufsize)
{
int err;
- struct atm_qos qos;
struct sockaddr_atmpvc addr;
int fd;
--- 79,85 ----
! int assign_vcc(char *astr, int encap, int bufsize, struct atm_qos qos)
{
int err;
struct sockaddr_atmpvc addr;
int fd;
***************
*** 106,117 ****
syslog(LOG_ERR,"failed to create socket %d, reason: %s", errno,strerror(errno));
!
! memset(&qos, 0, sizeof(qos));
! qos.aal = ATM_AAL5;
! qos.txtp.traffic_class = ATM_UBR;
! qos.txtp.max_sdu = 1524;
! qos.txtp.pcr = ATM_MAX_PCR;
! qos.rxtp = qos.txtp;
!
if ( (err=setsockopt(fd,SOL_SOCKET,SO_SNDBUF, &bufsize ,sizeof(bufsize))) )
syslog(LOG_ERR,"setsockopt SO_SNDBUF: (%d) %s\n",err, strerror(err));
--- 105,116 ----
syslog(LOG_ERR,"failed to create socket %d, reason: %s", errno,strerror(errno));
! if (qos.aal == 0) {
! qos.aal = ATM_AAL5;
! qos.txtp.traffic_class = ATM_UBR;
! qos.txtp.max_sdu = 1524;
! qos.txtp.pcr = ATM_MAX_PCR;
! qos.rxtp = qos.txtp;
! }
!
if ( (err=setsockopt(fd,SOL_SOCKET,SO_SNDBUF, &bufsize ,sizeof(bufsize))) )
syslog(LOG_ERR,"setsockopt SO_SNDBUF: (%d) %s\n",err, strerror(err));
***************
*** 148,155 ****
-
void usage(char *s)
{
! printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-a [itf.]vpi.vci]*]*\n", s);
exit(1);
}
--- 147,153 ----
void usage(char *s)
{
! printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-q qos] [-a [itf.]vpi.vci]*]*\n", s);
exit(1);
}
***************
*** 160,173 ****
{
int c, background=0, encap=0, sndbuf=8192;
!
lastsock=-1;
lastitf=0;
openlog (LOG_NAME,LOG_OPTION,LOG_FACILITY);
if (argc>1)
! while ((c = getopt(argc, argv,"a:bc:e:s:?h")) !=EOF)
switch (c) {
case 'a':
! assign_vcc(optarg, encap, sndbuf);
break;
case 'b':
--- 158,178 ----
{
int c, background=0, encap=0, sndbuf=8192;
! struct atm_qos reqqos;
lastsock=-1;
lastitf=0;
+ /* st qos to 0 */
+ memset(&reqqos, 0, sizeof(reqqos));
+
openlog (LOG_NAME,LOG_OPTION,LOG_FACILITY);
if (argc>1)
! while ((c = getopt(argc, argv,"q:a:bc:e:s:?h")) !=EOF)
switch (c) {
+ case 'q':
+ printf ("optarg : %s",optarg);
+ if (text2qos(optarg,&reqqos,0)) fprintf(stderr,"QOS parameter invalid\n");
+ break;
case 'a':
! assign_vcc(optarg, encap, sndbuf, reqqos);
break;
case 'b':
|