/* aaconn.c */ /* Test program to see if the atm stack can push an */ /* atm socket connect through to the ape25 driver. */ #include #include #include #include #include #include #ifdef GLIBC_PATCH #include #undef __GLIBC__ #include #include #else #include #include #include #endif int main( int argc, char **argv) { struct sockaddr_atmpvc addr; struct atm_qos qos; int s,size,offset; int rc; s = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5); printf("Socket call returned %d \n", s); qos.aal = 5; qos.txtp.traffic_class = ATM_UBR; qos.txtp.max_sdu = 768; qos.txtp.max_pcr = 5 * 1024 * 1024; qos.txtp.min_pcr = 1 * 1024 * 1024; qos.txtp.max_cdv = 1 * 1024 * 1024; qos.rxtp.traffic_class = ATM_UBR; qos.rxtp.max_sdu = 768; qos.rxtp.max_pcr = 5 * 1024 * 1024; qos.rxtp.min_pcr = 1 * 1024 * 1024; qos.rxtp.max_cdv = 1 * 1024 * 1024; rc = setsockopt(s, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)); printf("Return from setsock is %d \n", rc); addr.sap_family = AF_ATMPVC; addr.sap_addr.itf = 0; addr.sap_addr.vpi = 0; addr.sap_addr.vci = 33; rc = connect(s,(struct sockaddr *) &addr,sizeof(addr)); printf("Return from connect is %d \n", rc); }