OpenSS7 SS7 for the Common Man |
© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved. |
||||||||||||||||||||||||||
Home | Overview | Status | News | Documentation | Resources | About | |||||||||||||||||||||
File /code/strss7/drivers/str/str.ccstatic char const ident[] = "$Id: str.cc,v 0.8.2.3 2003/04/03 19:51:31 brian Exp $"; #define __NO_VERSION__ extern "C" { #define new new_ #define class class_ #define delete delete_ #define virtual virtual_ #define typename typename_ #include <linux/config.h> #include <linux/version.h> #ifdef MODVERSIONS #include <linux/modversions.h> #endif #include <linux/module.h> #include <sys/stream.h> #include <sys/stropts.h> #include <sys/cmn_err.h> #undef new #undef class #undef delete #undef virtual #undef typename } #pragma implementation "str.hh" #include "str.hh" int qp::m_r_ctl(mblk_t * mp) { return (-EPROTO); } int qp::m_r_data(mblk_t * mp) { return (-EPROTO); } int qp::m_r_proto(mblk_t * mp) { return (-EPROTO); } int qp::m_r_flush(mblk_t * mp) { return (-EPROTO); } int qp::m_r_error(mblk_t * mp) { return (-EPROTO); } int qp::m_r_hangup(mblk_t * mp) { return (-EPROTO); } static int m_r_ctl(qp * q, mblk_t * mp) { return (q->m_r_ctl(mp)); } static int m_r_data(qp * q, mblk_t * mp) { return (q->m_r_data(mp)); } static int m_r_proto(qp * q, mblk_t * mp) { return (q->m_r_proto(mp)); } static int m_r_pcproto(qp * q, mblk_t * mp) { return (q->m_r_proto(mp)); } static int m_r_flush(qp * q, mblk_t * mp) { return (q->m_r_flush(mp)); } static int m_r_error(qp * q, mblk_t * mp) { return (q->m_r_error(mp)); } static int m_r_hangup(qp * q, mblk_t * mp) { return (q->m_r_hangup(mp)); } static int (*r_ops[]) (qp *, mblk_t *) = { &m_r_data, &m_r_proto, /* M_PROTO 1 */ NULL, /* M_BREAK 2 */ &m_r_ctl, /* M_CTL 3 */ NULL, /* M_DELAY 4 */ NULL, /* M_IOCTL 5 */ NULL, /* M_PASSFP 6 */ NULL, /* M_RSE 7 */ NULL, /* M_SETOPTS 8 */ NULL, /* M_SIG 9 */ NULL, /* M_COPYIN 10 */ NULL, /* M_COPYOUT 11 */ &m_r_error, /* M_ERROR 12 */ &m_r_flush, /* M_FLUSH 13 */ &m_r_hangup, /* M_HANGUP 14 */ NULL, /* M_IOCACK 15 */ NULL, /* M_IOCNAK 16 */ NULL, /* M_IOCDATA 17 */ &m_r_pcproto, /* M_PCPROTO 18 */ NULL, /* M_PCRSE 19 */ NULL, /* M_PCSIG 20 */ NULL, /* M_READ 21 */ NULL, /* M_STOP 22 */ NULL, /* M_START 23 */ NULL, /* M_STARTI 24 */ NULL /* M_STOPI 25 */ }; int qp::rd(mblk_t * mp) { int type = mp->b_datap->db_type; if (0 <= type && type <= M_STOPI && r_ops[type]) return ((*r_ops) (this, mp)); return (-EOPNOTSUPP); }; int qp::m_w_ctl(mblk_t * mp) { return (-EPROTO); } int qp::m_w_data(mblk_t * mp) { return (-EPROTO); } int qp::m_w_proto(mblk_t * mp) { return (-EPROTO); } int qp::m_w_flush(mblk_t * mp) { return (-EPROTO); } int qp::m_w_error(mblk_t * mp) { return (-EPROTO); } int qp::m_w_hangup(mblk_t * mp) { return (-EPROTO); } static int m_w_ctl(qp * q, mblk_t * mp) { return (q->m_w_ctl(mp)); } static int m_w_data(qp * q, mblk_t * mp) { return (q->m_w_data(mp)); } static int m_w_proto(qp * q, mblk_t * mp) { return (q->m_w_proto(mp)); } static int m_w_pcproto(qp * q, mblk_t * mp) { return (q->m_w_proto(mp)); } static int m_w_flush(qp * q, mblk_t * mp) { return (q->m_w_flush(mp)); } static int m_w_error(qp * q, mblk_t * mp) { return (q->m_w_error(mp)); } static int m_w_hangup(qp * q, mblk_t * mp) { return (q->m_w_hangup(mp)); } static int (*w_ops[]) (qp *, mblk_t *) = { &m_w_data, /* M_DATA 0 */ &m_w_proto, /* M_PROTO 1 */ NULL, /* M_BREAK 2 */ &m_w_ctl, /* M_CTL 3 */ NULL, /* M_DELAY 4 */ NULL, /* M_IOCTL 5 */ NULL, /* M_PASSFP 6 */ NULL, /* M_RSE 7 */ NULL, /* M_SETOPTS 8 */ NULL, /* M_SIG 9 */ NULL, /* M_COPYIN 10 */ NULL, /* M_COPYOUT 11 */ &m_w_error, /* M_ERROR 12 */ &m_w_flush, /* M_FLUSH 13 */ &m_w_hangup, /* M_HANGUP 14 */ NULL, /* M_IOCACK 15 */ NULL, /* M_IOCNAK 16 */ NULL, /* M_IOCDATA 17 */ &m_w_pcproto, /* M_PCPROTO 18 */ NULL, /* M_PCRSE 19 */ NULL, /* M_PCSIG 20 */ NULL, /* M_READ 21 */ NULL, /* M_STOP 22 */ NULL, /* M_START 23 */ NULL, /* M_STARTI 24 */ NULL /* M_STOPI 25 */ }; int qp::wr(mblk_t * mp) { int type = mp->b_datap->db_type; if (0 <= type && type <= M_STOPI && r_ops[type]) return ((*w_ops) (this, mp)); return (-EOPNOTSUPP); }; qp::qp(queue_t * q) { rq = RD(q); wq = WR(q); rq->q_ptr = wq->q_ptr = this; if ((next = list)) next->prev = &next; prev = &list; }; qp::~qp(void) { rq->q_ptr = wq->q_ptr = NULL; if ((*prev = next)) next->prev = prev; }; extern "C" { INT q_rput(queue_t * q, mblk_t * mp) { qp *qp = (class qp *) q->q_ptr; return (INT) (qp->rput(mp)); } INT q_rsrv(queue_t * q) { qp *qp = (class qp *) q->q_ptr; return (INT) (qp->rsrv()); } INT q_wput(queue_t * q, mblk_t * mp) { qp *qp = (class qp *) q->q_ptr; return (INT) (qp->wput(mp)); } INT q_wsrv(queue_t * q) { qp *qp = (class qp *) q->q_ptr; return (INT) (qp->wsrv()); } }
|
|||||||||||||||||||||||||||
OpenSS7 SS7 for the Common Man |
Home | Overview | Status | News | Documentation | Resources | About | ||||||||||||||||||||
© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved. |