- case CC_DISCONNECT | INDICATION:
-
- // fall throug
- default:
- PERROR("unhandled message: prim(0x%x) dinfo(0x%x) msg->len(%d)\n", hh->prim, hh->dinfo, msg->len);
- return(-EINVAL);
- }
- free_msg(msg);
- return(0);
-}
-
-/* NOTE: te mode use iframe_t as header */
-int stack2manager_te(struct mISDNport *mISDNport, msg_t *msg)
-{
- class Port *port;
- class Pdss1 *pdss1;
- iframe_t *frm;
- char name[32];
-
- if (!msg || !mISDNport)
- return(-EINVAL);
- frm = (iframe_t *)msg->data;
- PDEBUG(DEBUG_ISDN, "prim(0x%x) dinfo(0x%x) msg->len(%d)\n", frm->prim, frm->dinfo, msg->len);
-
- /* find Port object of type ISDN */
- port = port_first;
- while(port)
- {
- if (port->p_type == PORT_TYPE_DSS1_TE_IN || port->p_type == PORT_TYPE_DSS1_TE_OUT)
- {
- pdss1 = (class Pdss1 *)port;
- /* check out correct stack */
- if (pdss1->p_m_mISDNport == mISDNport)
- /* check out correct id */
- if (frm->dinfo == pdss1->p_m_d_l3id)
- {
- /* found port, the message belongs to */
- break;
- }
- }
- port = port->next;
- }
- if (port)
- {
- pdss1->message_isdn(frm->prim, frm->dinfo, msg->data);
- free_msg(msg);
- return(0);
- }
-
- /* process new cr (before setup indication) */
-//printf("prim = 0x%x, looking for 0x%x\n",frm->prim, (CC_NEW_CR | INDICATION));
- if (frm->prim == (CC_NEW_CR | INDICATION))
- {
-
- /* creating port object */
- SPRINT(name, "%s-%d-in", mISDNport->ifport->interface->name, mISDNport->portnum);
- if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_TE_IN, mISDNport, name, NULL, 0, 0)))
- FATAL("Cannot create Port instance.\n");
- /* l3id will be set from dinfo at message_isdn */
- pdss1->message_isdn(frm->prim, frm->dinfo, msg->data);
- free_msg(msg);
- return(0);
- }
-
- if (frm->prim == (CC_RELEASE_CR | INDICATION))
- {
- PERROR("unhandled message from stack: call ref released (l3id=0x%x)\n", frm->dinfo);
- free_msg(msg);
- return(0);
- }
- PERROR("unhandled message: prim(0x%x) dinfo(0x%x) msg->len(%d)\n", frm->prim, frm->dinfo, msg->len);
- return(-EINVAL);
-}
-
-
-/*
- * sending message that were queued during L1 activation
- * or releasing port if link is down
- */
-void setup_queue(struct mISDNport *mISDNport, int link)
-{
- class Port *port;
- class Pdss1 *pdss1;
- struct message *message;