Kannel: Open Source WAP and SMS gateway  svn-r5335
wsp.h File Reference

Go to the source code of this file.

Data Structures

struct  WSPMachine
 
struct  WSPMethodMachine
 
struct  WSPPushMachine
 

Macros

#define INTEGER(name)   long name;
 
#define OCTSTR(name)   Octstr *name;
 
#define HTTPHEADERS(name)   List *name;
 
#define ADDRTUPLE(name)   WAPAddrTuple *name;
 
#define COOKIES(name)   List *name;
 
#define REFERER(name)   Octstr *name;
 
#define MACHINESLIST(name)   List *name;
 
#define CAPABILITIES(name)   List *name;
 
#define MACHINE(fields)   fields
 
#define INTEGER(name)   long name;
 
#define ADDRTUPLE(name)   WAPAddrTuple *name;
 
#define EVENT(name)   WAPEvent *name;
 
#define MACHINE(fields)   fields
 
#define INTEGER(name)   long name;
 
#define ADDRTUPLE(name)   WAPAddrTuple *name;
 
#define HTTPHEADER(name)   List *name;
 
#define MACHINE(fields)   fields
 

Typedefs

typedef struct WSPMachine WSPMachine
 
typedef struct WSPMethodMachine WSPMethodMachine
 
typedef struct WSPPushMachine WSPPushMachine
 

Enumerations

enum  wsp_encoding {
  WSP_TBD = 0, WSP_1_1 = 1, WSP_1_2 = 2, WSP_1_3 = 3,
  WSP_1_4 = 4, WSP_1_5 = 5, WSP_1_6 = 6
}
 
enum  wsp_abort_values {
  WSP_ABORT_PROTOERR = 0xe0, WSP_ABORT_DISCONNECT = 0xe1, WSP_ABORT_SUSPEND = 0xe2, WSP_ABORT_RESUME = 0xe3,
  WSP_ABORT_CONGESTION = 0xe4, WSP_ABORT_CONNECTERR = 0xe5, WSP_ABORT_MRUEXCEEDED = 0xe6, WSP_ABORT_MOREXCEEDED = 0xe7,
  WSP_ABORT_PEERREQ = 0xe8, WSP_ABORT_NETERR = 0xe9, WSP_ABORT_USERREQ = 0xea, WSP_ABORT_USERRFS = 0xeb,
  WSP_ABORT_USERPND = 0xec, WSP_ABORT_USERDCR = 0xed, WSP_ABORT_USERDCU = 0xee
}
 

Functions

long wsp_convert_http_status_to_wsp_status (long http_status)
 
WSPMachinefind_session_machine_by_id (int)
 

Macro Definition Documentation

◆ ADDRTUPLE [1/3]

#define ADDRTUPLE (   name)    WAPAddrTuple *name;

Definition at line 131 of file wsp.h.

◆ ADDRTUPLE [2/3]

#define ADDRTUPLE (   name)    WAPAddrTuple *name;

Definition at line 131 of file wsp.h.

◆ ADDRTUPLE [3/3]

#define ADDRTUPLE (   name)    WAPAddrTuple *name;

Definition at line 131 of file wsp.h.

◆ CAPABILITIES

#define CAPABILITIES (   name)    List *name;

Definition at line 115 of file wsp.h.

◆ COOKIES

#define COOKIES (   name)    List *name;

Definition at line 112 of file wsp.h.

◆ EVENT

#define EVENT (   name)    WAPEvent *name;

Definition at line 124 of file wsp.h.

◆ HTTPHEADER

#define HTTPHEADER (   name)    List *name;

Definition at line 132 of file wsp.h.

◆ HTTPHEADERS

#define HTTPHEADERS (   name)    List *name;

Definition at line 110 of file wsp.h.

◆ INTEGER [1/3]

#define INTEGER (   name)    long name;

Definition at line 130 of file wsp.h.

◆ INTEGER [2/3]

#define INTEGER (   name)    long name;

Definition at line 130 of file wsp.h.

◆ INTEGER [3/3]

#define INTEGER (   name)    long name;

Definition at line 130 of file wsp.h.

◆ MACHINE [1/3]

#define MACHINE (   fields)    fields

Definition at line 133 of file wsp.h.

◆ MACHINE [2/3]

#define MACHINE (   fields)    fields

Definition at line 133 of file wsp.h.

◆ MACHINE [3/3]

#define MACHINE (   fields)    fields

Definition at line 133 of file wsp.h.

◆ MACHINESLIST

#define MACHINESLIST (   name)    List *name;

Definition at line 114 of file wsp.h.

◆ OCTSTR

#define OCTSTR (   name)    Octstr *name;

Definition at line 109 of file wsp.h.

◆ REFERER

#define REFERER (   name)    Octstr *name;

Definition at line 113 of file wsp.h.

Typedef Documentation

◆ WSPMachine

typedef struct WSPMachine WSPMachine

Definition at line 99 of file wsp.h.

◆ WSPMethodMachine

Definition at line 100 of file wsp.h.

◆ WSPPushMachine

Definition at line 101 of file wsp.h.

Enumeration Type Documentation

◆ wsp_abort_values

Enumerator
WSP_ABORT_PROTOERR 
WSP_ABORT_DISCONNECT 
WSP_ABORT_SUSPEND 
WSP_ABORT_RESUME 
WSP_ABORT_CONGESTION 
WSP_ABORT_CONNECTERR 
WSP_ABORT_MRUEXCEEDED 
WSP_ABORT_MOREXCEEDED 
WSP_ABORT_PEERREQ 
WSP_ABORT_NETERR 
WSP_ABORT_USERREQ 
WSP_ABORT_USERRFS 
WSP_ABORT_USERPND 
WSP_ABORT_USERDCR 
WSP_ABORT_USERDCU 

Definition at line 80 of file wsp.h.

◆ wsp_encoding

Enumerator
WSP_TBD 
WSP_1_1 
WSP_1_2 
WSP_1_3 
WSP_1_4 
WSP_1_5 
WSP_1_6 

Definition at line 69 of file wsp.h.

69  {
70  WSP_TBD = 0, /* to be defined */
71  WSP_1_1 = 1,
72  WSP_1_2 = 2,
73  WSP_1_3 = 3,
74  WSP_1_4 = 4,
75  WSP_1_5 = 5,
76  WSP_1_6 = 6,
77 } wsp_encoding;
Definition: wsp.h:73
Definition: wsp.h:75
Definition: wsp.h:70
Definition: wsp.h:76
wsp_encoding
Definition: wsp.h:69
Definition: wsp.h:74
Definition: wsp.h:71
Definition: wsp.h:72

Function Documentation

◆ find_session_machine_by_id()

WSPMachine* find_session_machine_by_id ( int  )

Definition at line 1434 of file wsp_session.c.

References gwlist_search(), id_belongs_to_session(), and session_machines.

Referenced by return_reply(), and start_fetch().

1434  {
1435 
1437 }
void * gwlist_search(List *list, void *pattern, int(*cmp)(void *, void *))
Definition: list.c:486
static List * session_machines
Definition: wsp_session.c:123
static int id_belongs_to_session(void *, void *)
Definition: wsp_session.c:1440

◆ wsp_convert_http_status_to_wsp_status()

long wsp_convert_http_status_to_wsp_status ( long  http_status)

Definition at line 77 of file wsp.c.

References error().

Referenced by make_resume_reply_pdu(), and pack_into_result_datagram().

77  {
78  long hundreds, singles;
79 
80  /*
81  * The table is regular, and can be expected to stay regular in
82  * future versions of WSP. The status value is read as XYY,
83  * so that X is the first digit and Y is the value of the
84  * second two digits. This is encoded as a hex value 0xAB,
85  * where A == X and B == YY.
86  * This limits YY to the range 0-15, so an exception is made
87  * to allow larger YY values when X is 4. X value 5 is moved up
88  * to A value 6 to allow more room for YY when X is 4.
89  */
90 
91  hundreds = http_status / 100;
92  singles = http_status % 100;
93 
94  if ((hundreds == 4 && singles > 31) ||
95  (hundreds != 4 && singles > 15) ||
96  hundreds < 1 || hundreds > 5)
97  goto bad_status;
98 
99  if (hundreds > 4)
100  hundreds++;
101 
102  return hundreds * 16 + singles;
103 
104 bad_status:
105  error(0, "WSP: Unknown status code used internally. Oops.");
106  return 0x60; /* Status 500, or "Internal Server Error" */
107 }
void error(int err, const char *fmt,...)
Definition: log.c:648
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.