OpenSS7
SS7 for the
Common Man

© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved.
Last modified:

Home Overview Status News Documentation Resources About
   
 Overview
 Status
 News
 Documentation
 Resources
 About

   
Home Index Prev Next More Download Info FAQ Mail   Home -> Resources -> Browse Source -> strss7/drivers/ua/ua_data.h


File /code/strss7/drivers/ua/ua_data.h



#ifndef __UA_DATA_H__
#define __UA_DATA_H__

#ident "@(#) $RCSfile: ua_data.h,v $ $Name:  $($Revision: 0.8.2.1 $) $Date: 2002/10/18 02:26:19 $"

struct pp;
struct spp;
struct gp;
struct sp;
struct np;

typedef int (*m_array_t[]) (queue_t *, mblk_t *);

typedef struct ops {
	int (*create) (struct pp *);	/* create priv struct */
	int (*remove) (struct pp *);	/* remove priv struct */
	int (*r_prim) (queue_t *, mblk_t *);	/* read primitive */
	int (*w_prim) (queue_t *, mblk_t *);	/* write primitive */
} ops_t;

/*
 *  DP, LP Structures
 *  -------------------------------------------------------------------------
 *  This structure is used to link all stream queues into the data structures
 *  of the UA multiplexor regardless of whether they are upper or lower
 *  interfaces.  The signalling process structure is used to represent ASP,
 *  SGP and SPP proxies.  This structure is created whenever a stream or
 *  queue-pair is created at OPEN or LINK time.  We keep track of opens and
 *  links separately to distinguish the dev id versus the mux id.
 */
struct ua_driver;

typedef struct pp {
	struct pp *next;		/* next structure in list */
	struct pp **prev;		/* prev structure in list */
	struct pp *links;		/* structures we have I_LINKed */
	struct ua_driver *drv;		/* driver that we belong to */
	union {
		uint dev;		/* dev id for this structure */
		uint mux;		/* mux id for this structure */
	} id;
	uint type;			/* type of structure */
	queue_t *rq;			/* associated read queue */
	queue_t *wq;			/* associated write queue */
	queue_t *mq;			/* associated mgmt queue */
	uint bid;			/* buffer call id */
	uint state;			/* interface state */
	struct ops *ops;		/* read/write operations */
	/* TODO: put these below in private derived structure */
	union {
		struct sp *sp;		/* AS/SG for user/provider */
		struct spp *spp;	/* default signalling process proxy */
	} u;
} pp_t;

typedef pp_t dp_t;
typedef pp_t lp_t;

extern dp_t *ua_opens_list;		/* list of all opened streams */
extern lp_t *ua_links_list;		/* list of all linked streams */

/*
 *  SPP --> ASP, SGP Structures
 *  -------------------------------------------------------------------------
 *  This struct represents an ASP, SGP or SPP proxy.  There are three types of
 *  each proxy: SS7 (User/ASP or Provider/SGP), IPC (Peer/ASP, Peer/SGP) and
 *  UAP (remote/ASP, remote/SGP, remote/SPP).  Only the UAPs provide strict
 *  SIGTRAN syntax and semantics.  SS7 proxies are used to attach internal SS7
 *  Users or Providers to the model.  IPC proxies are used to interface
 *  inter-SGP and inter-ASP communication to the model.  UAP proxies are used
 *  to interface external ASP or SGP equipment to the model.
 */
#define UA_TYPE_NONE	0x00000000
#define UA_TYPE_UAP	0x00000100	/* remote SIGTRAN ASP/SGP/SPP */
#define UA_TYPE_IPC	0x00000200	/* peer internal ASP/SGP/SPP */
#define UA_TYPE_SS7	0x00000400	/* internal ASP(User) or SGP(Provider) */
#define UA_TYPE_MASK	0x0000ff00

#define UA_MODE_NONE	0x00000000
#define UA_MODE_SGP	0x00000001	/* structure is proxy for remote SGP */
#define UA_MODE_ASP	0x00000002	/* structure is proxy for remote ASP */
#define UA_MODE_SPP	0x00000004	/* structure is proxy for remote IPSP */
#define UA_MODE_MASK	0x000000ff

#define UA_PROT_NONE	0x00000000
#define UA_PROT_SL	0x00010000	/* SL/M2UA protocol */
#define UA_PROT_MTP	0x00020000	/* MTP/M3UA protocol */
#define UA_PROT_ISUP	0x00040000	/* ISUP/M3UA protocol */
#define UA_PROT_SCCP	0x00080000	/* SCCP/ SUA protocol */
#define UA_PROT_TCAP	0x00100000	/* TCAP/ TUA protocol */
#define UA_PROT_MASK	0x00ff0000

#define UA_STRM_NONE	0x00000000
#define UA_STRM_LM	0x01000000	/* stream has LM semantics only */
#define UA_STRM_SS7	0x02000000	/* stream has SS7 semantics */
#define UA_STRM_NSP	0x04000000	/* stream has NSP transport semantics */
#define UA_STRM_TSP	0x08000000	/* stream has TSP transport semantics */
#define UA_STRM_SCTP	0x10000000	/* stream has SCTP transport semantics */
#define UA_STRM_SSCOP	0x20000000	/* stream has SSCOP transport semanitcs */
#define UA_STRM_MASK	0xff000000

typedef struct spp {
	struct spp *next;		/* next structure in type list */
	struct spp **prev;		/* prev structure in type list */
	struct pp *pp;			/* dev or mux structure pointer */
	struct gp *gp;			/* graph of AS for this SPP */
	struct sp *sg;			/* SG for this SPP */
	uint id;			/* ASP Id */
	uint state;			/* state */
	uint level;			/* protocol level */
	uint version;			/* UA version */
	uint use_count;			/* use count for auto deallocation */
	bufq_t buf;			/* buffer for failovers */
	int (*recv) (struct spp *, mblk_t *);	/* recv method */
	int (*send) (struct spp *, mblk_t *);	/* send method */
} spp_t;

typedef spp_t asp_t;
typedef spp_t sgp_t;

extern asp_t *ua_asp_list;		/* list of ASP proxies */
extern sgp_t *ua_sgp_list;		/* list of SGP proxies */
extern spp_t *ua_spp_list;		/* list of SPP proxies *//* XXX */

#define ASP_DOWN	(1<<0)
#define ASP_INACTIVE	(1<<1)
#define ASP_ACTIVE	(1<<2)
#define ASP_WACK_BEAT	(1<<3)	/* T(beat) timer running */
#define ASP_WACK_ASPUP	(1<<4)	/* T(ack) timer running */
#define ASP_WACK_ASPDN	(1<<5)	/* T(ack) timer running */
#define ASP_WACK_ASPAC	(1<<6)	/* T(ack) timer running */
#define ASP_WACK_ASPIA	(1<<7)	/* T(ack) timer running */

/*
 *  GP --> ASP/AS Map, SGP/SG Map
 *  -------------------------------------------------------------------------
 *  This structure describes the role of an SPP within an SP.  For ASP/AS
 *  structures, this structure describes the role of an ASP within an AS.  For
 *  SGP/SG structures, this structure describes the role of an SGP within an
 *  SG.
 */
typedef struct gp {
	struct spp *spp;		/* this SPP associated with this SP */
	struct gp *spp_next;		/* next SPP associated with this SP */
	struct gp **spp_prev;		/* prev SPP associated with this SP */
	struct sp *sp;			/* this SP associated ith this SPP */
	struct gp *sp_next;		/* next SP associated ith this SPP */
	struct gp **s_prevp;		/* prev SP associated ith this SPP */
	uint state;			/* state of this SPP in this SP */
	uint loadshare;			/* loadshare selector (stripe) */
	uint broadcast;			/* broadcast selector (mirror) */
	uint priority;			/* priority of this SPP for this SP */
	uint cost;			/* cost of using this SPP for this SP */
	uint t_beat;			/* timer for heartbeats */
	uint t_ack;			/* timer for ack of messages */
} gp_t;

/*
 *  SP --> AS, SG
 *  -------------------------------------------------------------------------
 *  An Application Server is a collection of Application Server Process (ASP)
 *  proxies and is served by one or more Signalling Gateway processes.  A
 *  Signalling Gateway (SG) is a collection of Signalling Gateway Process
 *  (SGP) proxies and provides service to one or more Application Servers
 *  (AS).
 *
 *  Typically an AS at an ASP will have at least one internal (UA_TYPE_SS7)
 *  ASP proxy represending an SS7 user.  Typically an SG at an ASP will have
 *  at least one internal (UA_TYPE_SS7) SGP proxy representing an SS7
 *  provider.
 *
 *  For an AS node, the np graph is a graph of SGs serving this AS and the
 *  np_hash is a hash of SGs by load selector.  For an SG node, the np graph
 *  is a graph of ASs served by this SG and the np_hash is a hash of the ASs
 *  by Routing Context or Interface Identifier.
 *
 *  The overall state of the node can be down, inactive, or pending.  The
 *  pending state is used when a node does not have an active peer but is
 *  waiting in expectation that the peer will soon become active.
 *
 *  Typically at an ASP, multiple AS structures and multiple SG structures may
 *  exist.  Typically at an SGP, only one SG structure will exist (an SGP only
 *  belongs to one logical SG).
 */
#define UA_LSA_MASK 0xff

typedef struct sp {
	struct sp *next;		/* next struct in type list */
	struct sp **prev;		/* prev struct in type list */
	struct np *np;			/* graph of peer nodes for this SP */
	struct np **np_hash;		/* cache of peer nodes for this SP */
	struct gp *gp;			/* graph of SPPs for this node */
	struct pp *pp;			/* SS7 U/P for this SP */
	uint state;			/* state of this node */
	uint use_count;			/* use count for auto deallocation */
	uint tmode;			/* traffic mode for this AS/SG */
	uint min_count;			/* minimum number of active stripes */
	uint max_count;			/* maximum number of active stripes */
	uint sppdn_count;		/* SPPs in down state */
	uint sppia_count;		/* SPPs in inactive state */
	uint sppac_count;		/* SPPs in active state */
//      struct lsa  lsa[UA_LSA_MASK+1]; /* load selection control array         */
} sp_t;

typedef sp_t as_t;
typedef sp_t sg_t;

#define AS_DOWN		(1<<0)
#define AS_INACTIVE	(1<<1)
#define AS_ACTIVE	(1<<2)
#define AS_PENDING	(1<<3)
#define AS_BLOCKED	(1<<4)

/*
 *  NP --> AS/SG Map
 *  -------------------------------------------------------------------------
 *  This structure describes the relationship beteen AS and SG.  For an AS,
 *  this describes the SGs which provide service to the AS.  For an SG this
 *  describes the AS which are served by the SG.
 */
typedef struct np {
	struct sp *as;			/* this AS associated with this SG */
	struct np *as_next;		/* next AS associated with this SG */
	struct np **as_prev;		/* prev AS associated with this SG */
	struct sp *sg;			/* this SG associated with this AS */
	struct np *sg_next;		/* next SG associated wtih this AS */
	uint id;			/* id for this AS in this SG (RC) */
	uint state;			/* state of this SG serving this AS */
	uint loadshare;			/* loadshare selector (stripe) */
	uint priority;			/* priority of this SG for this AS */
	uint cost;			/* cost of this SG for this AS */
	struct rt *rt;			/* routing for this SG in this AS */
	struct rt **rt_hash;		/* routing for this SG in this AS */
} np_t;

#endif				/* __UA_DATA_H__ */


Home Index Prev Next More Download Info FAQ Mail   Home -> Resources -> Browse Source -> strss7/drivers/ua/ua_data.h

OpenSS7
SS7 for the
Common Man
Home Overview Status News Documentation Resources About

© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved.
Last modified: