Пример #1
0
int send_call_proceeding(SOCKET *sock)
{
    Q_DSC dsc;
    int size;

    q_create(&dsc,q_buffer,MAX_Q_MSG);
    q_assign(&dsc,QF_msg_type,ATM_MSG_CALL_PROC);
    q_assign(&dsc,QF_call_ref,sock->call_ref);
    if (sock->sig->mode == sm_net) {
	int vpci,vci;

	sock->pvc.sap_family = AF_ATMPVC;
	vpci = sock->sig->signaling_pvc.sap_addr.itf;
	sock->pvc.sap_addr.itf = get_itf(sock->sig,&vpci);
	sock->pvc.sap_addr.vpi = vpci;
	vci = get_vci(sock->pvc.sap_addr.itf);
	if (vci < 0) {
	    (void) q_close(&dsc);
	    return vci;
	}
	sock->pvc.sap_addr.vci = vci;
    }
    if (sock->sig->mode != sm_user) {
	q_assign(&dsc,QF_vpi,sock->pvc.sap_addr.vpi);
	q_assign(&dsc,QF_vci,sock->pvc.sap_addr.vci);
    }
    if (sock->ep_ref >= 0) q_assign(&dsc,QF_ep_ref,sock->ep_ref);
    if ((size = q_close(&dsc)) >= 0) to_signaling(sock->sig,q_buffer,size);
    return 0;
}
Пример #2
0
int get_vci(int itf)
{
    SOCKET *walk;
    int s,vci;

    s = get_pvc(itf,&vci);
    if (s < 0) return s;
    for (walk = sockets; walk; walk = walk->next)
	if (walk->pvc.sap_addr.itf == itf && walk->pvc.sap_addr.vci == vci) {
	    vci = get_vci(itf); /* this recursion will keep all the busy ones
				   open until we return */
	    break;
	}
    (void) close(s);
    return vci;
}