/********************************************************************************************************************************/ /* Created: 7-Sep-2011 11:33:42 by OpenVMS SDL EV2-3 */ /* Source: 07-SEP-2011 11:33:41 DISK$SYSMAN:[LAISHEV.WORK.SMPP]SMPPDEF.SDL;132 */ /********************************************************************************************************************************/ /*** MODULE SMPPDEF IDENT SMPPDEF-1-X ***/ #ifndef __SMPPDEF_LOADED #define __SMPPDEF_LOADED 1 #pragma __nostandard /* This file uses non-ANSI-Standard features */ #pragma __member_alignment __save #pragma __nomember_alignment #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __save /* Save the previously-defined required ptr size */ #pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */ #endif #ifdef __cplusplus extern "C" { #define __unknown_params ... #define __optional_params ... #else #define __unknown_params #define __optional_params ... #endif #ifndef __struct #if !defined(__VAXC) #define __struct struct #else #define __struct variant_struct #endif #endif #ifndef __union #if !defined(__VAXC) #define __union union #else #define __union variant_union #endif #endif /*++ */ /* Facility: */ /* SMPP (Short Message Peer to Peer)/ESME (External Short Message Entities) Service */ /* */ /* Abstract: */ /* An interface module defined SMPP entities was based on SMPP specification V3.4 */ /* */ /* Author: */ /* Ruslan R. Laishev */ /* */ /* Creation Date: 16-APR-2002 */ /* */ /* Modification History: */ /* */ /* 11-JUN-2003 RRL Added Destination Address types definition */ /* 6-OCT-2003 RRL Changed SMSLEN from 128 to 160 */ /* 7-OCT-2011 RRL Correct the 'tlv' structure. */ /* */ /*-- */ #define SMPP$K_VERSION 52 #define SMPP$K_SMSLEN 128 /* */ /**++ */ /** */ /** SMPP Protocol Data Unit (PDU) */ /** */ /**-- */ /* */ #define SMPP_PDU$M_CMD 0x7FFFFFFF #define SMPP_PDU$M_DIR 0x80000000 #ifdef __NEW_STARLET typedef struct _smpp_pdu { unsigned int smpp_pdu$l_length; /* The command_length field defines the total */ /* octet length of the SMPP PDU packet */ /* including the length field. */ __union { /* The command_id field identifies the particular */ /* SMPP PDU, e.g., submit_sm, query_sm, etc. */ __struct { unsigned smpp_pdu$v_cmd : 31; unsigned smpp_pdu$v_dir : 1; } smpp_pdu$r_cmd; unsigned int smpp_pdu$l_cmd; } smpp_pdu$r_id; unsigned int smpp_pdu$l_status; /* The command_status field indicates the */ /* success or failure of an SMPP request. */ /* It is relevant only in the SMPP response PDU */ /* and it must contain a NULL value in an SMPP */ /* request PDU. */ unsigned int smpp_pdu$l_seq; /* This field contains a sequence number which */ /* allows SMPP requests and responses to be */ /* associated for correlation purposes. The use of */ /* sequence numbers for message correlation */ /* allows SMPP PDUs to be exchanged */ /* asynchronously. */ unsigned char smpp_pdu$b_body [1]; } SMPP_PDU; #if !defined(__VAXC) #define smpp_pdu$r_cmd smpp_pdu$r_id.smpp_pdu$r_cmd #define smpp_pdu$v_cmd smpp_pdu$r_cmd.smpp_pdu$v_cmd #define smpp_pdu$v_dir smpp_pdu$r_cmd.smpp_pdu$v_dir #define smpp_pdu$l_cmd smpp_pdu$r_id.smpp_pdu$l_cmd #endif /* #if !defined(__VAXC) */ #else /* __OLD_STARLET */ struct smpp_pdu { unsigned int smpp_pdu$l_length; /* The command_length field defines the total */ /* octet length of the SMPP PDU packet */ /* including the length field. */ __union { /* The command_id field identifies the particular */ /* SMPP PDU, e.g., submit_sm, query_sm, etc. */ __struct { unsigned smpp_pdu$v_cmd : 31; unsigned smpp_pdu$v_dir : 1; } smpp_pdu$r_cmd; unsigned int smpp_pdu$l_cmd; } smpp_pdu$r_id; unsigned int smpp_pdu$l_status; /* The command_status field indicates the */ /* success or failure of an SMPP request. */ /* It is relevant only in the SMPP response PDU */ /* and it must contain a NULL value in an SMPP */ /* request PDU. */ unsigned int smpp_pdu$l_seq; /* This field contains a sequence number which */ /* allows SMPP requests and responses to be */ /* associated for correlation purposes. The use of */ /* sequence numbers for message correlation */ /* allows SMPP PDUs to be exchanged */ /* asynchronously. */ unsigned char smpp_pdu$b_body [1]; } ; #if !defined(__VAXC) #define smpp_pdu$v_cmd smpp_pdu$r_id.smpp_pdu$r_cmd.smpp_pdu$v_cmd #define smpp_pdu$v_dir smpp_pdu$r_id.smpp_pdu$r_cmd.smpp_pdu$v_dir #define smpp_pdu$l_cmd smpp_pdu$r_id.smpp_pdu$l_cmd #endif /* #if !defined(__VAXC) */ #endif /* #ifdef __NEW_STARLET */ /* */ /**++ */ /** */ /** SMPP, All optional parameters have the following general TLV (Tag, Length, Value) format. */ /** */ /**-- */ /* */ #ifdef __NEW_STARLET typedef struct _tlv { unsigned short int tlv$w_tag; /* The Tag field is used to */ /* uniquely identify the particular */ /* optional parameter in question. */ /* The optional parameter Tag field is */ /* always 2 octets in length.A tag ID */ unsigned short int tlv$w_len; /* The Length field indicates the length of */ /* the Value field in octets. */ /* Note that this length does not include the */ /* length of the Tag and Length fields. */ /* The optional parameter Length field is */ /* always 2 octets in length. */ __union { /* The Value field contains the actual data */ /* for the optional parameter in question. */ unsigned char tlv$b_val; unsigned short int tlv$w_val; unsigned int tlv$l_val; char tlv$t_val [1]; } tlv$r_val; } TLV; #if !defined(__VAXC) #define tlv$b_val tlv$r_val.tlv$b_val #define tlv$w_val tlv$r_val.tlv$w_val #define tlv$l_val tlv$r_val.tlv$l_val #define tlv$t_val tlv$r_val.tlv$t_val #endif /* #if !defined(__VAXC) */ #else /* __OLD_STARLET */ struct tlv { unsigned short int tlv$w_tag; /* The Tag field is used to */ /* uniquely identify the particular */ /* optional parameter in question. */ /* The optional parameter Tag field is */ /* always 2 octets in length.A tag ID */ unsigned short int tlv$w_len; /* The Length field indicates the length of */ /* the Value field in octets. */ /* Note that this length does not include the */ /* length of the Tag and Length fields. */ /* The optional parameter Length field is */ /* always 2 octets in length. */ __union { /* The Value field contains the actual data */ /* for the optional parameter in question. */ unsigned char tlv$b_val; unsigned short int tlv$w_val; unsigned int tlv$l_val; char tlv$t_val [1]; } tlv$r_val; } ; #if !defined(__VAXC) #define tlv$b_val tlv$r_val.tlv$b_val #define tlv$w_val tlv$r_val.tlv$w_val #define tlv$l_val tlv$r_val.tlv$l_val #define tlv$t_val tlv$r_val.tlv$t_val #endif /* #if !defined(__VAXC) */ #endif /* #ifdef __NEW_STARLET */ /* */ /**++ */ /** */ /** SMPP Command set */ /** */ /**-- */ /* */ #define SMPP_CMD$K_GENERIC_NACK -2147483648 #define SMPP_CMD$K_BIND_RECEIVER 1 #define SMPP_CMD$K_BIND_RECEIVER_RESP -2147483647 #define SMPP_CMD$K_BIND_TRANSMITTER 2 #define SMPP_CMD$K_BIND_TRANSMITTER_RESP -2147483646 #define SMPP_CMD$K_QUERY_SM 3 #define SMPP_CMD$K_QUERY_SM_RESP -2147483645 #define SMPP_CMD$K_SUBMIT_SM 4 #define SMPP_CMD$K_SUBMIT_SM_RESP -2147483644 #define SMPP_CMD$K_DELIVER_SM 5 #define SMPP_CMD$K_DELIVER_SM_RESP -2147483643 #define SMPP_CMD$K_UNBIND 6 #define SMPP_CMD$K_UNBIND_RESP -2147483642 #define SMPP_CMD$K_REPLACE_SM 7 #define SMPP_CMD$K_REPLACE_SM_RESP -2147483641 #define SMPP_CMD$K_CANCEL_SM 8 #define SMPP_CMD$K_CANCEL_SM_RESP -2147483640 #define SMPP_CMD$K_BIND_TRANSCEIVER 9 #define SMPP_CMD$K_BIND_TRANSCEIVER_RESP -2147483639 #define SMPP_CMD$K_OUTBIND 11 #define SMPP_CMD$K_ENQUIRE_LINK 21 #define SMPP_CMD$K_ENQUIRE_LINK_RESP -2147483627 #define SMPP_CMD$K_SUBMIT_MULTI 33 #define SMPP_CMD$K_SUBMIT_MULTI_RESP -2147483615 #define SMPP_CMD$K_ALERT_NOTIFICATION 258 #define SMPP_CMD$K_DATA_SM 259 #define SMPP_CMD$K_DATA_SM_RESP -2147483389 /* */ /**++ */ /** */ /** SMPP Command status set */ /** */ /**-- */ /* */ #define SMPP_STS$K_ESME_ROK 0 /* No Error */ #define SMPP_STS$K_ESME_RINVMSGLEN 1 /* Message Length is invalid */ #define SMPP_STS$K_ESME_RINVCMDLEN 2 /* Command Length is invalid */ #define SMPP_STS$K_ESME_RINVCMDID 3 /* Invalid Command ID */ #define SMPP_STS$K_ESME_RINVBNDSTS 4 /* Incorrect BIND Status for given command */ #define SMPP_STS$K_ESME_RALYBND 5 /* ESME Already in Bound State */ #define SMPP_STS$K_ESME_RINVPRTFLG 6 /* Invalid Priority Flag */ #define SMPP_STS$K_ESME_RINVREGDLVFLG 7 /* Invalid Registered Delivery Flag */ #define SMPP_STS$K_ESME_RSYSERR 8 /* System Error */ #define SMPP_STS$K_ESME_RINVSRCADR 10 /* Invalid Source Address */ #define SMPP_STS$K_ESME_RINVDSTADR 11 /* Invalid Dest Addr */ #define SMPP_STS$K_ESME_RINVMSGID 12 /* Message ID is invalid */ #define SMPP_STS$K_ESME_RBINDFAIL 13 /* Bind Failed */ #define SMPP_STS$K_ESME_RINVPASWD 14 /* Invalid Password */ #define SMPP_STS$K_ESME_RINVSYSID 15 /* Invalid System ID */ #define SMPP_STS$K_ESME_RCANCELFAIL 17 /* Cancel SM Failed */ #define SMPP_STS$K_ESME_RREPLACEFAIL 19 /* Replace SM Failed */ #define SMPP_STS$K_ESME_RMSGQFUL 20 /* Message Queue Full */ #define SMPP_STS$K_ESME_RINVSERTYP 21 /* Invalid Service Type */ #define SMPP_STS$K_ESME_RINVNUMDESTS 51 /* Invalid number of destinations */ #define SMPP_STS$K_ESME_RINVDLNAME 52 /* Invalid Distribution List name */ #define SMPP_STS$K_ESME_RINVDESTFLAG 64 /* Destination flag is invalid (submit_multi) */ #define SMPP_STS$K_ESME_RINVSUBREP 66 /* Invalid ubmit with replacerequest (i.e. submit_sm with replace_if_present_flag set) */ #define SMPP_STS$K_ESME_RINVESMCLASS 67 /* Invalid esm_class field data */ #define SMPP_STS$K_ESME_RCNTSUBDL 68 /* Cannot Submit to Distribution List */ #define SMPP_STS$K_ESME_RSUBMITFAIL 69 /* submit_sm or submit_multi failed */ #define SMPP_STS$K_ESME_RINVSRCTON 72 /* Invalid Source address TON */ #define SMPP_STS$K_ESME_RINVSRCNPI 73 /* Invalid Source address NPI */ #define SMPP_STS$K_ESME_RINVDSTTON 80 /* Invalid Destination address TON */ #define SMPP_STS$K_ESME_RINVDSTNPI 81 /* Invalid Destination address NPI */ #define SMPP_STS$K_ESME_RINVSYSTYP 83 /* Invalid system_type field */ #define SMPP_STS$K_ESME_RINVREPFLAG 84 /* Invalid replace_if_present flag */ #define SMPP_STS$K_ESME_RINVNUMMSGS 85 /* Invalid number of messages */ #define SMPP_STS$K_ESME_RTHROTTLED 88 /* Throttling error (ESME has exceeded allowed message limits) */ #define SMPP_STS$K_ESME_RINVSCHED 97 /* Invalid Scheduled Delivery Time */ #define SMPP_STS$K_ESME_RINVEXPIRY 98 /* Invalid message validity period (Expiry time) */ #define SMPP_STS$K_ESME_RINVDFTMSGID 99 /* Predefined Message Invalid or Not Found */ #define SMPP_STS$K_ESME_RX_T_APPN 100 /* ESME Receiver Temporary App Error Code */ #define SMPP_STS$K_ESME_RX_P_APPN 101 /* ESME Receiver Permanent App Error Code */ #define SMPP_STS$K_ESME_RX_R_APPN 102 /* ESME Receiver Reject Message Error Code */ #define SMPP_STS$K_ESME_RQUERYFAIL 103 /* query_sm request failed */ #define SMPP_STS$K_ESME_RINVOPTPARSTREAM 192 /* Error in the optional part of the PDU Body. */ #define SMPP_STS$K_ESME_ROPTPARNOTALLWD 193 /* Optional Parameter not allowed */ #define SMPP_STS$K_ESME_RINVPARLEN 194 /* Invalid Parameter Length. */ #define SMPP_STS$K_ESME_RMISSINGOPTPARAM 195 /* Expected Optional Parameter missing */ #define SMPP_STS$K_ESME_RINVOPTPARAMVAL 196 /* Invalid Optional Parameter Value */ #define SMPP_STS$K_ESME_RDELIVERYFAILURE 254 /* Delivery Failure (used for data_sm_resp) */ #define SMPP_STS$K_ESME_RUNKNOWNERR 255 /* Unknown Error */ /* */ /**++ */ /** */ /** Type of Number (TON,addr_ton, source_addr_ton, dest_addr_ton, esme_addr_ton) */ /** */ /**-- */ /* */ #define SMPP_TON$K_UNKNW 0 /* Unknown */ #define SMPP_TON$K_INTL 1 /* International */ #define SMPP_TON$K_NTL 2 /* National */ #define SMPP_TON$K_NET 3 /* Network Specific */ #define SMPP_TON$K_SUBNUM 4 /* Subscriber Number */ #define SMPP_TON$K_ALPHANUM 5 /* Alphanumeric */ #define SMPP_TON$K_ABRVD 6 /* Abbreviated */ /* */ /**++ */ /** */ /** Numeric Plan Indicator (NPI,addr_npi, source_addr_npi, dest_addr_npi, esme_addr_npi) */ /** */ /**-- */ /* */ #define SMPP_NPI$K_UNKNW 0 /* Unknown */ #define SMPP_NPI$K_ISDN 1 /* ISDN (E163/E164) */ #define SMPP_NPI$K_DATA 2 /* Data (X.121) */ #define SMPP_NPI$K_TELEX 3 /* Telex (F.69) */ #define SMPP_NPI$K_LANMOB 4 /* Land Mobile (E.212) */ #define SMPP_NPI$K_NTL 5 /* National */ #define SMPP_NPI$K_PVT 6 /* Private */ #define SMPP_NPI$K_ERMES 7 /* ERMES */ #define SMPP_NPI$K_INET 8 /* Internet (IP) */ #define SMPP_NPI$K_WAP 9 /* WAP Client Id (to be defined by WAP Forum) */ /* */ /**++ */ /** */ /** ESM Classes */ /** */ /**-- */ /* */ #define ESM_CLASS$M_MM 0x3 #define ESM_CLASS$M_MT 0x3C #define ESM_CLASS$M_GSM 0xC0 #ifdef __NEW_STARLET typedef union _esm_class { unsigned char esm_class$b_attr; __struct { unsigned esm_class$v_mm : 2; unsigned esm_class$v_mt : 4; unsigned esm_class$v_gsm : 2; } esm_class$r_attr; } ESM_CLASS; #if !defined(__VAXC) #define esm_class$v_mm esm_class$r_attr.esm_class$v_mm #define esm_class$v_mt esm_class$r_attr.esm_class$v_mt #define esm_class$v_gsm esm_class$r_attr.esm_class$v_gsm #endif /* #if !defined(__VAXC) */ #else /* __OLD_STARLET */ union esm_class { unsigned char esm_class$b_attr; __struct { unsigned esm_class$v_mm : 2; unsigned esm_class$v_mt : 4; unsigned esm_class$v_gsm : 2; } esm_class$r_attr; } ; #if !defined(__VAXC) #define esm_class$v_mm esm_class$r_attr.esm_class$v_mm #define esm_class$v_mt esm_class$r_attr.esm_class$v_mt #define esm_class$v_gsm esm_class$r_attr.esm_class$v_gsm #endif /* #if !defined(__VAXC) */ #endif /* #ifdef __NEW_STARLET */ /* */ /* The esm_class parameter is encoded as follows in the submit_sm, submit_multi and data_sm */ /* (ESME -> SMSC) PDUs: */ /* */ /* Messaging Mode (bits 1-0) */ #define ESM_CLASS$MM_DEFAULT 0 /* Default SMSC Mode (e.g. Store and Forward) */ #define ESM_CLASS$MM_DGRAM 1 /* Datagram mode */ #define ESM_CLASS$MM_FWD 2 /* Forward (i.e. Transaction) mode */ #define ESM_CLASS$MM_STFWD 3 /* Store and Forward mode */ /* Message Type (bits 5-2) */ #define ESM_CLASS$MT_DEFAULT 0 /* Default message Type (i.e. normal message) */ #define ESM_CLASS$MT_DACK 2 /* Short Message contains ESME Delivery Acknowledgement */ #define ESM_CLASS$MT_MACK 4 /* Short Message contains ESME Manual/User Acknowledgement */ /* GSM Network Specific Features (bits 7-6) */ #define ESM_CLASS$GSM_DEFAULT 0 /* No specific features selected */ #define ESM_CLASS$GSM_UDHI 1 /* UDHI Indicator (only relevant for MT short messages) */ #define ESM_CLASS$GSM_RP 2 /* Set Reply Path (only relevant for GSM network) */ #define ESM_CLASS$GSM_UDHIRP 3 /* Set UDHI and Reply Path (only relevant for GSM network) */ /* */ /* The esm_class parameter is encoded as follows in a deliver_sm and data_sm (SMSC -> ESME) */ /* PDUs: */ /* */ /* Message Type (bits 5-2) */ #define ESM_CLASS$MT_DEFAULT 0 /* Default message Type (i.e. normal message) */ #define ESM_CLASS$MT_DRCPT 1 /* Short Message contains SMSC Delivery Receipt */ #define ESM_CLASS$MT_SMEDACK 2 /* Short Message contains SME Delivery Acknowledgement */ /* x x 0 0 1 1 x x reserved */ #define ESM_CLASS$MT_SMEMACK 4 /* Short Message contains SME Manual/User Acknowledgment */ /* x x 0 1 0 1 x x reserved */ #define ESM_CLASS$MT_CABRT 6 /* Short Message contains Conversation Abort (Korean CDMA) */ /* x x 0 1 1 1 x x reserved */ #define ESM_CLASS$MT_IDN 8 /* Short Message contains Intermediate Delivery Notification */ /* GSM Network Specific Features (bits 7-6) */ #define ESM_CLASS$GSM_DEFAULT 0 /* No specific features selected */ #define ESM_CLASS$GSM_UDHISET 1 /* UDHI Indicator set */ #define ESM_CLASS$GSM_RPSET 2 /* Reply Path */ #define ESM_CLASS$GSM_UDHIRPSET 3 /* UDHI and Reply Path */ /* */ /**++ */ /** */ /** Registered Delivery */ /** */ /**-- */ /* */ #define REG_DLV$M_DR 0x3 #define REG_DLV$M_ACK 0xC #define REG_DLV$M_IN 0x10 #ifdef __NEW_STARLET typedef union _reg_dlv { unsigned char reg_dlv$b_par; __struct { unsigned reg_dlv$v_dr : 2; unsigned reg_dlv$v_ack : 2; unsigned reg_dlv$v_in : 1; unsigned reg_dlv$v_fill_0_ : 3; } reg_dlv$r_par; } REG_DLV; #if !defined(__VAXC) #define reg_dlv$v_dr reg_dlv$r_par.reg_dlv$v_dr #define reg_dlv$v_ack reg_dlv$r_par.reg_dlv$v_ack #define reg_dlv$v_in reg_dlv$r_par.reg_dlv$v_in #endif /* #if !defined(__VAXC) */ #else /* __OLD_STARLET */ union reg_dlv { unsigned char reg_dlv$b_par; __struct { unsigned reg_dlv$v_dr : 2; unsigned reg_dlv$v_ack : 2; unsigned reg_dlv$v_in : 1; unsigned reg_dlv$v_fill_0_ : 3; } reg_dlv$r_par; } ; #if !defined(__VAXC) #define reg_dlv$v_dr reg_dlv$r_par.reg_dlv$v_dr #define reg_dlv$v_ack reg_dlv$r_par.reg_dlv$v_ack #define reg_dlv$v_in reg_dlv$r_par.reg_dlv$v_in #endif /* #if !defined(__VAXC) */ #endif /* #ifdef __NEW_STARLET */ /* SMSC Delivery Receipt (bits 1 and 0) */ #define REG_DLV$DR_DEFAULT 0 /* No specific features selected */ #define REG_DLV$DR_ANY 1 /* SMSC Delivery Receipt requested where final delivery */ /* outcome is delivery success or failure */ #define REG_DLV$DR_ERR 2 /* SMSC Delivery Receipt requested where the final */ /* delivery outcome is delivery failure */ /* x x x x x x 1 1 reserved */ /* SME originated Acknowledgement (bits 3 and 2) */ #define REG_DLV$ACK_DEFAULT 0 /* No specific features selected */ #define REG_DLV$ACK_DLV 1 /* SME Delivery Acknowledgement requested */ #define REG_DLV$ACK_MAN 2 /* SME Manual/User Acknowledgment requested */ #define REG_DLV$ACK_BOTH 3 /* Both Delivery and Manual/User Acknowledgment requested */ /* Intermediate Notification (bit 5) */ #define REG_DLV$IN_DEFAULT 0 /* No specific features selected */ #define REG_DLV$IN_IN 1 /* Intermediate notification requested */ /* */ /**++ */ /** */ /** Data Coding */ /** */ /**-- */ /* */ #define DC$K_DEFAULT 0 /* SMSC Default Alphabet */ #define DC$K_IA5 1 /* IA5 (CCITT T.50)/ASCII (ANSI X3.4) */ #define DC$K_BIN 2 /* Octet unspecified (8-bit binary) */ #define DC$K_LATIN1 3 /* Latin 1 (ISO-8859-1) */ #define DC$K_BIN2 4 /* Octet unspecified (8-bit binary) */ #define DC$K_JIS 5 /* JIS (X 0208-1990) */ #define DC$K_ISOCYR 6 /* Cyrllic (ISO-8859-5) */ #define DC$K_HEBREW 7 /* Latin/Hebrew (ISO8859-8) */ #define DC$K_UCS2 8 /* UCS2 (ISO/IEC-10646) */ #define DC$K_PICT 9 /* Pictogram Encoding */ #define DC$K_ISO2022JP 11 /* ISO-2022-JP (Music Codes) */ #define DC$K_EKANJI 13 /* Extended Kanji JIS(X 0212-1990) */ #define DC$K_KSC5601 14 /* KS C 5601 */ /* */ /**++ */ /** */ /** Priority Flag */ /** */ /**-- */ /* */ #define PRIO$ANSI_136_BULK 0 #define PRIO$ANSI_136_NORMAL 1 #define PRIO$ANSI_136_URGENT 2 #define PRIO$ANSI_136_VERY_URGENT 3 #define PRIO$IS_95_NORMAL 0 #define PRIO$IS_95_INTERACTIVE 1 #define PRIO$IS_95_URGENT 2 #define PRIO$IS_95_EMERGENCY 3 #define PRIO$GSM_PRIO0 0 #define PRIO$GSM_PRIO1 1 #define PRIO$GSM_PRIO2 2 #define PRIO$GSM_PRIO3 3 /* */ /* Other constans skiped by RRL ... */ /* */ /* */ /**++ */ /** */ /** Message States */ /** */ /**-- */ /* */ #define MSG_ST$K_ENROUTE 1 /* The message is in enroute state. */ #define MSG_ST$K_DELIVERED 2 /* Message is delivered to destination. */ #define MSG_ST$K_EXPIRED 3 /* Message validity period has expired. */ #define MSG_ST$K_DELETED 4 /* Message has been deleted. */ #define MSG_ST$K_UNDELIVERABLE 5 /* Message is undeliverable. */ #define MSG_ST$K_ACCEPTED 6 /* Message is in accepted state */ /* (i.e. has been manually read */ /* on behalf of the subscriber by */ /* customer service) */ #define MSG_ST$K_UNKNOWN 7 /* Message is in invalid state */ #define MSG_ST$K_REJECTED 8 /* Message is in a rejected state */ /* */ /**++ */ /** */ /** SMPP Session Description */ /** */ /**-- */ /* */ #define SMPP_SST$K_CLOSED 0 /* CLOSED (Unbound and Disconnected) */ /* An ESME has unbound from the SMSC and has closed the network */ /* connection. The SMSC may also unbind from the ESME. */ #define SMPP_SST$K_OPEN 2 /* OPEN (Connected and Bind Pending) */ /* An ESME has established a network connection to */ /* the SMSC but has not yet issued a */ /* Bind request. */ #define SMPP_SST$K_BOUND_TX 4 /* A connected ESME has requested to bind as an ESME */ /* Transmitter (by issuing a bind_transmitter PDU) */ /* and has received a response from the SMSC authorising its */ /* bind request. */ #define SMPP_SST$K_BOUND_RX 6 /* A connected ESME has requested to bind as an ESME Receiver */ /* (by issuing a bind_receiver PDU) and has received a response */ /* from the SMSC authorising its Bind request. */ #define SMPP_SST$K_BOUND_TRX 8 /* A connected ESME has requested to bind as an ESME */ /* Transceiver (by issuing a bind_transceiver PDU) and */ /* has received a response from the SMSC authorising its */ /* Bind request. An ESME bound as a Transceiver supports */ /* the complete set of operations supported by a Transmitter */ /* ESME and a Receiver ESME. */ /* */ /**++ */ /** */ /** SMPP/ESME Session context */ /** */ /**-- */ /* */ #define ESME_CTX$K_MARK 1297307987 #ifdef __NEW_STARLET typedef struct _esme_ctx { unsigned int esme_ctx$l_mark; /* A special field used as marke for the context */ unsigned int esme_ctx$l_seq; /* Sequence number used in preparing a PDU */ unsigned int esme_ctx$l_state; /* SMPP Session state, see SMPP_SST$ */ unsigned int esme_ctx$l_netchan; /* A network I/O context/VMS channel number */ void *esme_ctx$a_userctx; /* A user defined and maitained context */ } ESME_CTX; #else /* __OLD_STARLET */ struct esme_ctx { unsigned int esme_ctx$l_mark; /* A special field used as marke for the context */ unsigned int esme_ctx$l_seq; /* Sequence number used in preparing a PDU */ unsigned int esme_ctx$l_state; /* SMPP Session state, see SMPP_SST$ */ unsigned int esme_ctx$l_netchan; /* A network I/O context/VMS channel number */ void *esme_ctx$a_userctx; /* A user defined and maitained context */ } ; #endif /* #ifdef __NEW_STARLET */ /* */ /**++ */ /** */ /** SMPP PDU - Type Definitions */ /** */ /**-- */ /* */ #define SMPP_DTYPE$K_INT 0 /* An unsigned value with the defined number of octets. */ /* The octets will always be transmitted MSB first (Big Endian). */ #define SMPP_DTYPE$K_ASCIZ 2 /* A series of ASCII characters terminated with the NULL character. */ #define SMPP_DTYPE$K_DECASCIZ 4 /* A series of ASCII characters, each character representing a */ /* decimal digit (0 - 9) and terminated with the NULL character. */ #define SMPP_DTYPE$K_HEXASCIZ 6 /* A series of ASCII characters, each character representing a */ /* hexadecimal digit (0 - F) and terminated with the NULL character. */ #define SMPP_DTYPE$K_OCTETS 8 /* A series of octets, not necessarily NULL terminated. */ /* */ /**++ */ /** */ /** A SMPP parameter Tag definitions */ /** */ /**-- */ /* */ #define SMPP_PTAG$K_MANDATORY 5120 #define SMPP_PTAG$K_SID 5120 /* System Id, Identifies the ESME system */ /* requesting to bind as a transmitter with the SMSC. */ #define SMPP_PTAG$K_PWD 5121 /* The password may be used by the SMSC to authenticate the ESME */ /* requesting to bind. */ #define SMPP_PTAG$K_STYPE 5122 /* Identifies the type of ESME system requesting to bind as a transmitter */ /* with the SMSC. */ #define SMPP_PTAG$K_VER 5123 /* Indicates the version of the SMPP protocol supported by the ESME. */ #define SMPP_PTAG$K_TON 5124 /* Indicates Type of Number of the ESME address. */ /* If not known set to NULL. */ #define SMPP_PTAG$K_NPI 5125 /* Numbering Plan Indicator for ESME address. */ /* If not known set to NULL. */ #define SMPP_PTAG$K_RANGE 5126 /* The ESME address. */ /* If not known set to NULL. */ #define SMPP_PTAG$K_MSGID 5127 /* This field contains the SMSC */ /* message ID of the submitted message. It may be used at a */ /* later stage to query the status of a message, cancel or */ /* replace the message. */ #define SMPP_PTAG$K_SRCTON 5128 /* Type of Number for source address. */ /* If not known, set to "Unknown" (0x00). */ #define SMPP_PTAG$K_SRCNPI 5129 /* Numbering Plan Indicator for ESME address. */ /* If not known set to NULL. */ #define SMPP_PTAG$K_SRC 5130 /* Address of SME which originated this message. */ #define SMPP_PTAG$K_DESTTON 5131 /* Type of Number for source address. */ /* If not known, set to "Unknown" (0x00). */ #define SMPP_PTAG$K_DESTNPI 5132 /* Numbering Plan Indicator for ESME address. */ /* If not known set to NULL. */ #define SMPP_PTAG$K_DEST 5133 /* Address of SME which originated this message. */ #define SMPP_PTAG$K_ESM_CLASS 5134 /* Indicates Message Mode and Message Type. */ #define SMPP_PTAG$K_REG_DLV 5135 /* Indicator for requesting a SMSC delivery receipt or an */ /* SME acknowledgement */ #define SMPP_PTAG$K_DC 5136 /* Indicates the encoding scheme of the payload data */ #define SMPP_PTAG$K_FINDATE 5137 /* Date and time when the queried */ /* message reached a final state. For */ /* messages which have not yet */ /* reached a final state this field will */ /* contain a single NULL octet. */ #define SMPP_PTAG$K_MSGSTATE 5138 /* Specifies the status of the queried short message. */ #define SMPP_PTAG$K_ERRCODE 5139 /* Where appropriate this holds a */ /* network error code defining the */ /* reason for failure of message delivery. */ #define SMPP_PTAG$K_SCHEDTM 5140 /* New scheduled delivery time for the short message. */ /* Set to NULL, if updating of the */ /* original scheduled delivery time is not desired. */ #define SMPP_PTAG$K_PERIOD 5141 /* New expiration time for the short message. Set to NULL, if */ /* updating of the original expiration time is not required. */ #define SMPP_PTAG$K_DEF_MSGID 5142 /* New pre-defined (canned) message identifier. */ #define SMPP_PTAG$K_SMSLEN 5143 /* Length of new short message in octets. */ #define SMPP_PTAG$K_SMSBODY 5144 /* New short message to replace existing message. */ #define SMPP_PTAG$K_REPLIF 5145 /* Flag indicating if submitted message should replace an */ /* existing message. */ #define SMPP_PTAG$K_OPTIONAL 5146 /* It's a just a flag that a command can have optional parameter(s) */ #define SMPP_PTAG$K_PROTO 5147 /* Protocol Identifier. Network Specific field. */ #define SMPP_PTAG$K_PRIO 5148 /* Designates the priority of the message. */ /* The recommended use of system_id is to identify the binding entity, e.g., "InternetGW" in the case of an */ /* Internet Gateway or Voice Mail System. */ /* The password is used for authentication to secure SMSC access. The ESME may set the password to NULL */ /* to gain insecure access (if allowed by SMSC administration). */ /* The system_type (optional) may be used to categorise the system, e.g., "EMAIL", "WWW", etc. */ #define DC$K_DEFAULT 0 /* SMSC Default Alphabet */ /* */ /**++ */ /** */ /** A SMPP optional parameters Tag definitions */ /** */ /**-- */ /* */ /* Tag Value Wireless Network Technology */ #define SMPP_PTAG$K_DADDR_SU 5 /* dest_addr_subunit 0x0005 GSM */ #define SMPP_PTAG$K_DADDR_NT 6 /* dest_network_type 0x0006 Generic */ #define SMPP_PTAG$K_DEST_BT 7 /* dest_bearer_type 0x0007 Generic */ #define SMPP_PTAG$K_DEST_TID 8 /* dest_telematics_id 0x0008 GSM */ #define SMPP_PTAG$K_SADDR_SU 13 /* source_addr_subunit 0x000D GSM */ #define SMPP_PTAG$K_SADDR_NT 14 /* source_network_type 0x000E Generic */ #define SMPP_PTAG$K_SRC_BT 15 /* source_bearer_type 0x000F Generic */ #define SMPP_PTAG$K_SRC_TID 16 /* source_telematics_id 0x0010 GSM */ #define SMPP_PTAG$K_QOS_TTL 23 /* qos_time_to_live 0x0017 Generic */ #define SMPP_PTAG$K_PAYLD_T 25 /* payload_type 0x0019 Generic */ #define SMPP_PTAG$K_ADDSTS 29 /* additional_status_info_text 0x001D Generic */ #define SMPP_PTAG$K_RMSGID 30 /* receipted_message_id 0x001E Generic */ #define SMPP_PTAG$K_MMSGWFAC 48 /* ms_msg_wait_facilities 0x0030 GSM */ #define SMPP_PTAG$K_PRIVIND 513 /* privacy_indicator 0x0201 CDMA, TDMA */ #define SMPP_PTAG$K_SSUBADDR 514 /* source_subaddress 0x0202 CDMA, TDMA */ #define SMPP_PTAG$K_DSUBADDR 515 /* dest_subaddress 0x0203 CDMA, TDMA */ #define SMPP_PTAG$K_UMSGREF 516 /* user_message_reference 0x0204 Generic */ #define SMPP_PTAG$K_URESPCODE 517 /* user_response_code 0x0205 CDMA, TDMA */ #define SMPP_PTAG$K_SRCPORT 522 /* source_port 0x020A Generic */ #define SMPP_PTAG$K_DESTPORT 523 /* destination_port 0x020B Generic */ #define SMPP_PTAG$K_SARMSGREF 524 /* sar_msg_ref_num 0x020C Generic */ #define SMPP_PTAG$K_LNGIND 525 /* language_indicator 0x020D CDMA, TDMA */ #define SMPP_PTAG$K_SARSEGS 526 /* sar_total_segments 0x020E Generic */ #define SMPP_PTAG$K_SARSEQ 527 /* sar_segment_seqnum 0x020F Generic */ #define SMPP_PTAG$K_SCINTFVER 528 /* SC_interface_version 0x0210 Generic */ #define SMPP_PTAG$K_CBNPIND 770 /* callback_num_pres_ind 0x0302 TDMA */ #define SMPP_PTAG$K_CBATAG 771 /* callback_num_atag 0x0303 TDMA */ #define SMPP_PTAG$K_NUMMSGS 772 /* number_of_messages 0x0304 CDMA */ #define SMPP_PTAG$K_CBNUM 897 /* callback_num 0x0381 CDMA, TDMA, GSM, iDEN */ #define SMPP_PTAG$K_DPFRES 1056 /* dpf_result 0x0420 Generic */ #define SMPP_PTAG$K_SETDPF 1057 /* set_dpf 0x0421 Generic */ #define SMPP_PTAG$K_MSAVAIL 1058 /* ms_availability_status 0x0422 Generic */ #define SMPP_PTAG$K_NETERR 1059 /* network_error_code 0x0423 Generic */ #define SMPP_PTAG$K_MSGPAYLD 1060 /* message_payload 0x0424 Generic */ #define SMPP_PTAG$K_DELYVRES 1061 /* delivery_failure_reason 0x0425 Generic */ #define SMPP_PTAG$K_MOREMSGS 1062 /* more_messages_to_send 0x0426 GSM */ #define SMPP_PTAG$K_MSGSTATE 1063 /* message_state 0x0427 Generic */ #define SMPP_PTAG$K_USSDSOP 1281 /* ussd_service_op 0x0501 GSM (USSD) */ #define SMPP_PTAG$K_DISPTM 4609 /* display_time 0x1201 CDMA, TDMA */ #define SMPP_PTAG$K_SMSSIG 4611 /* sms_signal 0x1203 TDMA */ #define SMPP_PTAG$K_MSVALID 4612 /* ms_validity 0x1204 CDMA, TDMA */ #define SMPP_PTAG$K_ALERT 4876 /* alert_on_message_delivery 0x130C CDMA */ #define SMPP_PTAG$K_ITSREPLYT 4992 /* its_reply_type 0x1380 CDMA */ #define SMPP_PTAG$K_ITSSESSINF 4995 /* its_session_info 0x1383 CDMA */ /* */ /**++ */ /** */ /** Destination Address types */ /** */ /**-- */ /* */ #define SMPP_DA$K_SME 1 /* SME Address */ #define SMPP_DA$K_DL 1 /* Distribution List */ /* */ /**++ */ /** */ /** A SMPP parameter definition structure, it's used internaly by ESME API */ /** */ /**-- */ /* */ #ifdef __NEW_STARLET typedef struct _smpp_par { unsigned short int smpp_par$w_tag; /* Parameter tag, see SMPP_PTAG$ */ unsigned short int smpp_par$w_type; /* Parameter type, see SMPP_DTYPE$* constants */ unsigned short int smpp_par$w_maxlen; /* Parameter maximum length */ __struct { __union { unsigned char *defval$a_sts; /* Default string value */ unsigned int defval$l_int; /* Default INT value */ } defval$r_val; unsigned short int defval$w_len; } smpp_par$r_defval; } SMPP_PAR; #if !defined(__VAXC) #define defval$r_val smpp_par$r_defval.defval$r_val #define defval$a_sts defval$r_val.defval$a_sts #define defval$l_int defval$r_val.defval$l_int #define defval$w_len smpp_par$r_defval.defval$w_len #endif /* #if !defined(__VAXC) */ #else /* __OLD_STARLET */ struct smpp_par { unsigned short int smpp_par$w_tag; /* Parameter tag, see SMPP_PTAG$ */ unsigned short int smpp_par$w_type; /* Parameter type, see SMPP_DTYPE$* constants */ unsigned short int smpp_par$w_maxlen; /* Parameter maximum length */ __struct { __union { unsigned char *defval$a_sts; /* Default string value */ unsigned int defval$l_int; /* Default INT value */ } defval$r_val; unsigned short int defval$w_len; } smpp_par$r_defval; } ; #if !defined(__VAXC) #define defval$a_sts smpp_par$r_defval.defval$r_val.defval$a_sts #define defval$l_int smpp_par$r_defval.defval$r_val.defval$l_int #define defval$w_len smpp_par$r_defval.defval$w_len #endif /* #if !defined(__VAXC) */ #endif /* #ifdef __NEW_STARLET */ #ifdef __NEW_STARLET typedef struct _par { unsigned short int par$w_tag; /* Parameter tag, see SMPP_PTAG$ */ SMPP_PAR *par$a_ptr; /* A pointer to parameter descriptor */ } PAR; #else /* __OLD_STARLET */ struct par { unsigned short int par$w_tag; /* Parameter tag, see SMPP_PTAG$ */ void *par$a_ptr; /* A pointer to parameter descriptor */ } ; #endif /* #ifdef __NEW_STARLET */ #define SMPP_PAR$K_MAXPAR 32 #ifdef __NEW_STARLET typedef struct _smpp_cmd { int smpp_cmd$l_cmd; /* Command tag, see SMPP_CMD$ */ /* sst LONGWORD UNSIGNED; /* Required session state, see SMPP_SST$ */ PAR smpp_cmd$r_args [32]; /* A list of mandatory parameters */ } SMPP_CMD; #else /* __OLD_STARLET */ struct smpp_cmd { int smpp_cmd$l_cmd; /* Command tag, see SMPP_CMD$ */ /* sst LONGWORD UNSIGNED; /* Required session state, see SMPP_SST$ */ struct par smpp_cmd$r_args [32]; /* A list of mandatory parameters */ } ; #endif /* #ifdef __NEW_STARLET */ /* */ /**++ */ /** */ /** Core SMPP/ESME routines prototype section */ /** */ /**-- */ /* */ #define esme_api_init ESME_API_INIT #ifdef __NEW_STARLET int esme_api_init( void *ctx, void *connsts); #else /* __OLD_STARLET */ int esme_api_init(__unknown_params); #endif /* #ifdef __NEW_STARLET */ #define esme_api_shut ESME_API_SHUT #ifdef __NEW_STARLET int esme_api_shut( void *ctx); #else /* __OLD_STARLET */ int esme_api_shut(__unknown_params); #endif /* #ifdef __NEW_STARLET */ #define esme_api_tx ESME_API_TX #ifdef __NEW_STARLET int esme_api_tx( void *ctx, unsigned int smpp_cmd, void *items, unsigned int smpp_seq, unsigned int smpp_sts); #else /* __OLD_STARLET */ int esme_api_tx(__unknown_params); #endif /* #ifdef __NEW_STARLET */ #define esme_api_rx ESME_API_RX #ifdef __NEW_STARLET int esme_api_rx( void *ctx, void *items, unsigned int *smpp_resp, unsigned int *smpp_sts, void *optresp, unsigned int *optresplen, unsigned int *smpp_seq); #else /* __OLD_STARLET */ int esme_api_rx(__unknown_params); #endif /* #ifdef __NEW_STARLET */ #define esme_api_err2cond ESME_API_ERR2COND #ifdef __NEW_STARLET int esme_api_err2cond( unsigned int esmests); #else /* __OLD_STARLET */ int esme_api_err2cond(__unknown_params); #endif /* #ifdef __NEW_STARLET */ #pragma __member_alignment __restore #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __SMPPDEF_LOADED */