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/tali/tali_sccp.c#ident "@(#) $RCSfile: tali_sccp.c,v $ $Name: $($Revision: 0.8.2.2 $) $Date: 2003/04/03 19:51:37 $" static char const ident[] = "$RCSfile: tali_sccp.c,v $ $Name: $($Revision: 0.8.2.2 $) $Date: 2003/04/03 19:51:37 $"; #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> #include <sys/dki.h> #include "../debug.h" #include "../bufq.h" #include "tali.h" #include "tali_data.h" #include "tali_msgs.h" /* * ========================================================================= * * STREAMS Message Handling * * ========================================================================= * * Management Message Handling * * ------------------------------------------------------------------------- */ /* * ------------------------------------------------------------------------- * * SCCP User (SCCPU) Stream Message Handling * * ------------------------------------------------------------------------- * * SCCP User --> TALI Primitives * ----------------------------------- * This is the SCCPU upper write routines. This takes SCCP user primitives * and converts them to SCCP M_DATA and M_CTL messages, if required. If the * provider is a local SG, then the primitives are forwarded as is. * * These are primitives send from a local SCCP user to the TALI layer on the * upper mux stream. This is part of the TALI at an IP node. Each message * is converted from an SCCP user request or response primitive to a TALI * message. These functions are pure translation only. When they return * zero, they return the SCCP primitive translated in 'mpp'. When they * return non-zero, they return an error and 'mpp' is untouched. */ static int sccp_u_info_req(queue_t * q, mblk_t * mp) { } static int sccp_u_bind_req(queue_t * q, mblk_t * mp) { } static int sccp_u_unbind_req(queue_t * q, mblk_t * mp) { } static int sccp_u_unitdata_req(queue_t * q, mblk_t * mp) { } static int sccp_u_optmgmt_req(queue_t * q, mblk_t * mp) { } static int sccp_u_w_ioctl(queue_t * q, mblk_t * mp) { } static int sccp_u_w_data(queue_t * q, mblk_t * mp) { return (-EOPNOTSUPP); } static int sccp_u_w_proto(queue_t * q, mblk_t * mp) { switch (*((long *) mp->b_wptr)) { case N_INFO_REQ: return sccp_u_info_req(q, mp); case N_BIND_REQ: return sccp_u_bind_req(q, mp); case N_UNBIND_REQ: return sccp_u_unbind_req(q, mp); case N_UNITDATA_REQ: return sccp_u_unitdata_req(q, mp); case N_OPTMGMT_REQ: return sccp_u_optmgmt_req(q, mp); } return (-EOPNOTSUPP); } static int sccp_u_w_pcproto(queue_t * q, mblk_t * mp) { return sccp_u_w_proto(q, mp); } static int sccp_u_w_prim(queue_t * q, mblk_t * mp) { switch (mp->b_datap->db_type) { case M_DATA: return sccp_u_w_data(q, mp); case M_PROTO: return sccp_u_w_proto(q, mp); case M_PCPROTO: return sccp_u_w_pcproto(q, mp); case M_IOCTL: return sccp_u_w_ioctl(q, mp); case M_FLUSH: return tali_w_flush(q, mp); } return (-EOPNOTSUPP); } /* * TALI --> SCCP User Primitives * ----------------------------------- */ static int sccp_u_r_data(queue_t * q, mblk_t * mp) { return sccp_r_msg(q, mp); } static int sccp_u_r_ctl(queue_t * q, mblk_t * mp) { return sccp_r_msg(q, mp); } static int sccp_u_r_prim(queue_t * q, mblk_t * mp) { switch (mp->b_datap->db_type) { case M_DATA: return sccp_u_r_data(q, mp); case M_CTL: return sccp_u_r_ctl(q, mp); case M_FLUSH: return tali_r_flush(q, mp); } return (5); } /* * ------------------------------------------------------------------------- * * SCCP Provider (SCCPP) Stream Message Handling * * ------------------------------------------------------------------------- */ static int sccp_l_w_data(queue_t * q, mblk_t * mp) { return sccp_w_msg(q, mp); } static int sccp_l_w_ctl(queue_t * q, mblk_t * mp) { return sccp_w_msg(q, mp); } static int sccp_l_w_error(queue_t * q, mblk_t * mp) { } static int sccp_l_w_hangup(queue_t * q, mblk_t * mp) { } static int sccp_l_w_prim(queue_t * q, mblk_t * mp) { switch (mp->b_datap->db_type) { case M_DATA: return sccp_l_w_data(q, mp); case M_CTL: return sccp_l_w_ctl(q, mp); case M_ERROR: return sccp_l_w_error(q, mp); case M_HANGUP: return sccp_l_w_hangup(q, mp); case M_FLUSH: return tali_w_flush(q, mp); } } /* * SCCP Provider --> TALI Primitives * ----------------------------------- * This is the SCCP lower read routines. This takes SCCP primitives and * converts them to TALI M_DATA and M_CTL messages, if required. If the user * is a local IP, then the primitives are forwarded as is. */ static int sccp_l_info_ack(queue_t * q, mblk_t ** mpp) { } static int sccp_l_bind_ack(queue_t * q, mblk_t ** mpp) { } static int sccp_l_error_ack(queue_t * q, mblk_t ** mpp) { } static int sccp_l_ok_ack(queue_t * q, mblk_t ** mpp) { } static int sccp_l_unitdata_ind(queue_t * q, mblk_t ** mpp) { } static int sccp_l_uderror_ind(queue_t * q, mblk_t ** mpp) { } static int sccp_l_r_proto(queue_t * q, mblk_t * mp) { switch (*((long *) mp->b_rptr)) { case N_INFO_ACK: return sccp_l_info_ack(q, mp); case N_BIND_ACK: return sccp_l_bind_ack(q, mp); case N_ERROR_ACK: return sccp_l_error_ack(q, mp); case N_OK_ACK: return sccp_l_ok_ack(q, mp); case N_UNITDATA_IND: return sccp_l_unitdata_ind(q, mp); case N_UDERROR_IND: return sccp_l_uderror_ind(q, mp); } return (-ENOTSUPP); } static int sccp_l_r_pcproto(queue_t * q, mblk_t * mp) { return sccp_l_r_proto(q, mp); } static int sccp_l_r_error(queue_t * q, mblk_t * mp) { } static int sccp_l_r_hangup(queue_t * q, mblk_t * mp) { } static int sccp_l_r_prim(queue_t * q, mblk_t * mp) { switch (mp->b_datap->db_type) { case M_PROTO: return sccp_l_r_proto(q, mp); case M_PCPROTO: return sccp_l_r_pcproto(q, mp); case M_ERROR: return sccp_l_r_error(q, mp); case M_HANGUP: return sccp_l_r_hangup(q, mp); case M_FLUSH: return tali_r_flush(q, mp); } return (-EOPNOTSUPP); } /* * ------------------------------------------------------------------------- * * TCP (SCTP) TLI Transport Message Handling * * ------------------------------------------------------------------------- * * TALI --> TCP (SCTP) TLI Transport Primitives * ------------------------------------------------------------------------- */ static int tali_x_w_data(queue_t * q, mblk_t * mp) { } static int tali_x_w_ctl(queue_t * q, mblk_t * mp) { } static int tali_x_w_error(queue_t * q, mblk_t * mp) { } static int tali_x_w_hangup(queue_t * q, mblk_t * mp) { } static int tali_x_w_prim(queue_t * q, mblk_t * mp) { switch (mp->b_datap->db_type) { case M_DATA: return tali_x_w_data(q, mp); case M_CTL: return tali_x_w_ctl(q, mp); case M_ERROR: return tali_x_w_error(q, mp); case M_HANGUP: return tali_x_w_hangup(q, mp); case M_FLUSH: return tali_w_flush(q, mp); } return (-EOPNOTSUPP); } /* * TCP (SCTP) TLI Transport -- SCCP Primitives * ------------------------------------------------------------------------- */
|
|||||||||||||||||||||||||||
OpenSS7 SS7 for the Common Man |
Home | Overview | Status | News | Documentation | Resources | About | ||||||||||||||||||||
© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved. |