Hi list,

attached patch adds the WSP Encoding-Version handling properly?! to
the WSP session state machine et all.

Please review. This patch is against cvs-20030625, so beware if you
try to apply to current cvs head tree.

Here is a summary:

  * wap/wsp.h: added WSP_1_x enumeration values to identify which WSP
Encoding-Version is used within a session.
  * wap/wsp_headers.h: re-declare wsp_headers_pack() function to add
required WSP version.
  * wap/wsp_server_session_machine.def: added
INTEGER(encoding_version) to hold the version within the WSPMachine.
  * wap/wsp_server_session_states.def: populates the aboe
sm->encoding_version with the appropriate version parsed our of the
request WSP headers.
  * wap/wsp_session.c: added WSP encoding-version mapping functions
wsp_encoding_string_to_version(Octstr *enc) and
wsp_encoding_version_to_string(int version)
  * wap/wsp_strings.c: added VSTRING() define for "versioned STRING"
and VASSIGN() for "versioned ASSIGN" of the .def values.
  * wap/wsp_strings.def: added WSP enumeration values to the
definition tables
  * <all other files>: addopted calling to wsp_headers_pack() with the
version.

Please review and vote for commit. This has been tested on our MMSC
WAP GW and it works as expected.

Stipe

[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
diff -ur --exclude=CVS* old/gateway/test/test_headers.c gateway/test/test_headers.c
--- old/gateway/test/test_headers.c     Fri Apr  4 13:51:04 2003
+++ gateway/test/test_headers.c Thu Aug  7 16:59:52 2003
@@ -119,7 +119,7 @@
     filename = octstr_create(argv[1]);
     headers = octstr_read_file(octstr_get_cstr(filename));
     split_headers(headers, &split, &expected);
-    packed = wsp_headers_pack(split, 0);
+    packed = wsp_headers_pack(split, 0, WSP_1_2);
     unpacked = wsp_headers_unpack(packed, 0);
 
     if (list_len(unpacked) != list_len(expected)) {
diff -ur --exclude=CVS* old/gateway/wap/wsp.h gateway/wap/wsp.h
--- old/gateway/wap/wsp.h       Mon Apr 22 17:24:14 2002
+++ gateway/wap/wsp.h   Thu Aug  7 15:33:22 2003
@@ -10,6 +10,14 @@
  * int WSP_accepted_header_code_pages[] = { -1 };
  */
 
+typedef enum {
+       WSP_1_1 = 1, 
+    WSP_1_2 = 2, 
+    WSP_1_3 = 3, 
+    WSP_1_4 = 4,
+    WSP_1_5 = 5,
+} wsp_encoding;
+
 /* See Table 35 of the WSP standard */
 enum wsp_abort_values {
        WSP_ABORT_PROTOERR = 0xe0,
diff -ur --exclude=CVS* old/gateway/wap/wsp_headers.c gateway/wap/wsp_headers.c
--- old/gateway/wap/wsp_headers.c       Thu Jun 19 13:49:12 2003
+++ gateway/wap/wsp_headers.c   Thu Aug  7 17:00:51 2003
@@ -1808,7 +1757,10 @@
     start = octstr_len(packed);
 
     /* Parameter = Typed-parameter | Untyped-parameter */
-    keytoken = wsp_string_to_parameter(parm->key);
+    /* keytoken = wsp_string_to_parameter(parm->key); */
+    /* XXX this should obey what kind of WSP Encoding-Version the client is using */
+    keytoken = wsp_string_to_versioned_parameter(parm->key, WSP_1_2);
+   
     if (keytoken >= 0) {
         /* Typed-parameter = Well-known-parameter-token Typed-value */
         /* Well-known-parameter-token = Integer-value */
@@ -2123,8 +2075,11 @@
 
 static int pack_field_name(Octstr *packed, Octstr *value)
 {
+    /* XXX we need to obey which WSP encoding-version to use */
+    /* return pack_constrained_value(packed, value,
+                                  wsp_string_to_header(value)); */
     return pack_constrained_value(packed, value,
-                                  wsp_string_to_header(value));
+                                  wsp_string_to_versioned_header(value, WSP_1_2));
 }
 
 static int pack_language(Octstr *packed, Octstr *value)
@@ -2232,7 +2187,9 @@
     long media;
 
     parms = strip_parameters(value);
-    media = wsp_string_to_content_type(value);
+    /* XXX we need to obey which WSP encoding-version to use */
+    /* media = wsp_string_to_content_type(value); */
+    media = wsp_string_to_versioned_content_type(value, WSP_1_2);
 
     /* See if we can fit this in a Constrained-media encoding */
     if (parms == NULL && media <= MAX_SHORT_INTEGER) {
@@ -2877,7 +2835,9 @@
         long fieldnum;
 
         http_header_get(headers, i, &fieldname, &value);
-        fieldnum = wsp_string_to_header(fieldname);
+        /* XXX we need to obey which WSP encoding-version to use */
+        /* fieldnum = wsp_string_to_header(fieldname); */
+        fieldnum = wsp_string_to_versioned_header(fieldname, wsp_version);
 
         errors = 0;
 
diff -ur --exclude=CVS* old/gateway/wap/wsp_headers.h gateway/wap/wsp_headers.h
--- old/gateway/wap/wsp_headers.h       Mon Nov 20 20:55:54 2000
+++ gateway/wap/wsp_headers.h   Thu Aug  7 17:05:41 2003
@@ -21,6 +76,6 @@
  * and return the encoded headers as an Octstr. 
  * The second argument is true if the encoded headers should have
  * a leading content-type field.  See the note for wsp_headers_unpack. */
-Octstr *wsp_headers_pack(List *headers, int separate_content_type);
+Octstr *wsp_headers_pack(List *headers, int separate_content_type, int wsp_version);
 
 #endif
diff -ur --exclude=CVS* old/gateway/wap/wsp_server_method_states.def 
gateway/wap/wsp_server_method_states.def
--- old/gateway/wap/wsp_server_method_states.def        Tue Nov 28 22:15:33 2000
+++ gateway/wap/wsp_server_method_states.def    Thu Aug  7 17:06:25 2003
@@ -260,7 +260,7 @@
                new_pdu->u.Reply.status = 
                        wsp_convert_http_status_to_wsp_status(e->status);
                new_pdu->u.Reply.headers = 
-                       wsp_headers_pack(e->response_headers, 1);
+                       wsp_headers_pack(e->response_headers, 1, WSP_1_2);
                new_pdu->u.Reply.data = octstr_duplicate(e->response_body);
 
                /* Send TR-Result.req to WTP */
diff -ur --exclude=CVS* old/gateway/wap/wsp_server_session_machine.def 
gateway/wap/wsp_server_session_machine.def
--- old/gateway/wap/wsp_server_session_machine.def      Tue Apr 30 11:07:03 2002
+++ gateway/wap/wsp_server_session_machine.def  Thu Aug  7 14:28:13 2003
@@ -19,23 +19,24 @@
 
 
 MACHINE(
-       INTEGER(state)
-       INTEGER(connect_handle)
-       INTEGER(resume_handle)
-       INTEGER(session_id)
-       ADDRTUPLE(addr_tuple)
+    INTEGER(state)
+    INTEGER(connect_handle)
+    INTEGER(resume_handle)
+    INTEGER(session_id)
+    ADDRTUPLE(addr_tuple)
 
-       CAPABILITIES(request_caps)
-       CAPABILITIES(reply_caps)
+    CAPABILITIES(request_caps)
+    CAPABILITIES(reply_caps)
 
-       INTEGER(MOR_push)
-       INTEGER(client_SDU_size)
+    INTEGER(MOR_push)
+    INTEGER(client_SDU_size)
+    INTEGER(encoding_version)
        
-       HTTPHEADERS(http_headers)
-       COOKIES(cookies)
-        REFERER(referer_url)
-       MACHINESLIST(methodmachines)
-        MACHINESLIST(pushmachines)
+    HTTPHEADERS(http_headers)
+    COOKIES(cookies)
+    REFERER(referer_url)
+    MACHINESLIST(methodmachines)
+    MACHINESLIST(pushmachines)
 )
 
 #undef INTEGER
diff -ur --exclude=CVS* old/gateway/wap/wsp_server_session_states.def 
gateway/wap/wsp_server_session_states.def
--- old/gateway/wap/wsp_server_session_states.def       Tue Dec  3 13:33:10 2002
+++ gateway/wap/wsp_server_session_states.def   Thu Aug  7 16:42:22 2003
@@ -49,12 +49,31 @@
                }
 
                if (pdu->u.Connect.headers_len > 0) {
-                       List *hdrs;
+            List *hdrs;
+            Octstr *encoding;
                        
-                       hdrs = wsp_headers_unpack(pdu->u.Connect.headers, 0);
-                       http_header_pack(hdrs);
-                       gw_assert(sm->http_headers == NULL);
-                       sm->http_headers = hdrs;
+            hdrs = wsp_headers_unpack(pdu->u.Connect.headers, 0);
+            http_header_pack(hdrs);
+            gw_assert(sm->http_headers == NULL);
+            sm->http_headers = hdrs;
+
+            /*
+             * Get WSP encoding version if provided by device and remember in
+             * session machine for later use in encoding tokenized values.
+             */
+            encoding = http_header_value(sm->http_headers, 
octstr_imm("Encoding-Version"));
+            if (encoding != NULL) {
+                debug("wsp",0,"WSP: Session machine: Encoding-Version: %s", 
+                      octstr_get_cstr(encoding));
+                sm->encoding_version = wsp_encoding_string_to_version(encoding);
+            } else {
+                /* WAP-230-WSP-20010705-a, section 8.4.2.70, page 97 defines
+                 * by a MUST argument that a non-present Encoding-Version header 
+                 * should be interpreted as WSP 1.2 compliant.
+                 */
+                sm->encoding_version = WSP_1_2; 
+            }
+            octstr_destroy(encoding);
                }
 
                /* Send S-Connect.ind to application layer */
diff -ur --exclude=CVS* old/gateway/wap/wsp_session.c gateway/wap/wsp_session.c
--- old/gateway/wap/wsp_session.c       Thu Jun 19 13:49:12 2003
+++ gateway/wap/wsp_session.c   Thu Aug  7 17:03:57 2003
@@ -2,6 +2,7 @@
  * wsp_session.c - Implement WSP session oriented service
  *
  * Lars Wirzenius
+ * Stipe Tolj
  */
 
 
@@ -127,7 +128,8 @@
 
 static void main_thread(void *);
 static int id_belongs_to_session (void *, void *);
-
+static int wsp_encoding_string_to_version(Octstr *enc);
+static Octstr *wsp_encoding_version_to_string(int version);
 
 
 /***********************************************************************
@@ -1011,6 +1013,8 @@
     /* First the case that we have no Encoding-Version header at all. 
      * This case we must assume that the client supports version 1.2
      * or lower. */
+
+    /*
     if (is_default_version(m)) {
         encoding_version = octstr_create("1.2");
     } else if (is_higher_version(m)) {
@@ -1022,60 +1026,65 @@
     }  else {   
         encoding_version = octstr_create("1.3");
     }
+    */
 
     headers = http_create_empty_headers();
+    encoding_version = wsp_encoding_version_to_string(m->encoding_version);
     http_header_add(headers, "Encoding-Version", octstr_get_cstr(encoding_version));
     octstr_destroy(encoding_version);
 
     return headers;
 }
 
-static Octstr *make_connectreply_pdu(WSPMachine *m) {
-       WSP_PDU *pdu;
-       Octstr *os;
-       List *caps;
-        List *reply_headers;
+static Octstr *make_connectreply_pdu(WSPMachine *m) 
+{
+    WSP_PDU *pdu;
+    Octstr *os;
+    List *caps;
+    List *reply_headers;
        
-       pdu = wsp_pdu_create(ConnectReply);
+    pdu = wsp_pdu_create(ConnectReply);
 
-       pdu->u.ConnectReply.sessionid = m->session_id;
+    pdu->u.ConnectReply.sessionid = m->session_id;
 
-       caps = make_capabilities_reply(m);
-       pdu->u.ConnectReply.capabilities = wsp_cap_pack_list(caps);
-       wsp_cap_destroy_list(caps);
+    caps = make_capabilities_reply(m);
+    pdu->u.ConnectReply.capabilities = wsp_cap_pack_list(caps);
+    wsp_cap_destroy_list(caps);
 
-        reply_headers = make_reply_headers(m);
-       pdu->u.ConnectReply.headers = wsp_headers_pack(reply_headers, 0);
-        http_destroy_headers(reply_headers);
+    reply_headers = make_reply_headers(m);
+    pdu->u.ConnectReply.headers = 
+        wsp_headers_pack(reply_headers, 0, m->encoding_version);
+    http_destroy_headers(reply_headers);
        
-       os = wsp_pdu_pack(pdu);
-       wsp_pdu_destroy(pdu);
+    os = wsp_pdu_pack(pdu);
+    wsp_pdu_destroy(pdu);
 
-       return os;
+    return os;
 }
 
 
-static Octstr *make_resume_reply_pdu(WSPMachine *m, List *headers) {
-       WSP_PDU *pdu;
-       Octstr *os;
+static Octstr *make_resume_reply_pdu(WSPMachine *m, List *headers) 
+{
+    WSP_PDU *pdu;
+    Octstr *os;
 
-       pdu = wsp_pdu_create(Reply);
+    pdu = wsp_pdu_create(Reply);
 
-       /* Not specified for Resume replies */
-       pdu->u.Reply.status = wsp_convert_http_status_to_wsp_status(HTTP_OK);
-       if (headers == NULL) {
-               headers = http_create_empty_headers();
-               pdu->u.Reply.headers = wsp_headers_pack(headers, 1);
-               http_destroy_headers(headers);
-       } else {
-               pdu->u.Reply.headers = wsp_headers_pack(headers, 1);
-       }
-       pdu->u.Reply.data = octstr_create("");
+    /* Not specified for Resume replies */
+    pdu->u.Reply.status = wsp_convert_http_status_to_wsp_status(HTTP_OK);
+    if (headers == NULL) {
+        headers = http_create_empty_headers();
+        pdu->u.Reply.headers = wsp_headers_pack(headers, 1, m->encoding_version);
+        http_destroy_headers(headers);
+    } else {
+        pdu->u.Reply.headers = wsp_headers_pack(headers, 1, m->encoding_version);
+    }
+    pdu->u.Reply.data = octstr_create("");
 
-       os = wsp_pdu_pack(pdu);
-       wsp_pdu_destroy(pdu);
+    os = wsp_pdu_pack(pdu);
+    wsp_pdu_destroy(pdu);
 
-       return os;
+    return os;
 }
 
 static WSP_PDU *make_confirmedpush_pdu(WAPEvent *e)
@@ -1089,11 +1098,11 @@
  */
         if (e->u.S_ConfirmedPush_Req.push_headers == NULL) {
            headers = http_create_empty_headers();
-            pdu->u.ConfirmedPush.headers = wsp_headers_pack(headers, 1);
+            pdu->u.ConfirmedPush.headers = wsp_headers_pack(headers, 1, WSP_1_2);
             http_destroy_headers(headers);
         } else
             pdu->u.ConfirmedPush.headers = 
-                wsp_headers_pack(e->u.S_ConfirmedPush_Req.push_headers, 1);
+                wsp_headers_pack(e->u.S_ConfirmedPush_Req.push_headers, 1, WSP_1_2);
    
         if (e->u.S_ConfirmedPush_Req.push_body == NULL)
            pdu->u.ConfirmedPush.data = octstr_create("");
@@ -1115,11 +1124,11 @@
  */
         if (e->u.S_Push_Req.push_headers == NULL) {
            headers = http_create_empty_headers();
-            pdu->u.Push.headers = wsp_headers_pack(headers, 1);
+            pdu->u.Push.headers = wsp_headers_pack(headers, 1, WSP_1_2);
             http_destroy_headers(headers);
         } else
             pdu->u.Push.headers = 
-                wsp_headers_pack(e->u.S_Push_Req.push_headers, 1);
+                wsp_headers_pack(e->u.S_Push_Req.push_headers, 1, WSP_1_2);
    
         if (e->u.S_Push_Req.push_body == NULL)
            pdu->u.Push.data = octstr_create("");
@@ -1407,6 +1416,7 @@
        wap_event_destroy(ab);
 }
 
+
 static void abort_pushes(WSPMachine *sm, long reason)
 {
         WAPEvent *ab;
@@ -1431,6 +1441,7 @@
        return list_search(session_machines, &id, id_belongs_to_session);
 }
 
+
 static int id_belongs_to_session (void *wsp_ptr, void *pid) {
        WSPMachine *wsp;
        int *id;
@@ -1443,10 +1454,57 @@
 }
 
 
+static int wsp_encoding_string_to_version(Octstr *enc) 
+{
+    int v;
+    
+    /* default will be WSP 1.2, as defined by WAPWSP */
+    v = WSP_1_2;    
 
+    if (octstr_compare(enc, octstr_imm("1.1")) == 0) {
+        v = WSP_1_1;
+    }
+    else if (octstr_compare(enc, octstr_imm("1.2")) == 0) {
+        v = WSP_1_2;
+    }
+    else if (octstr_compare(enc, octstr_imm("1.3")) == 0) {
+        v = WSP_1_3;
+    }
+    else if (octstr_compare(enc, octstr_imm("1.4")) == 0) {
+        v = WSP_1_4;
+    }
+    else if (octstr_compare(enc, octstr_imm("1.5")) == 0) {
+        v = WSP_1_5;
+    }
 
+    return v;
+}
 
-
-
-
+static Octstr *wsp_encoding_version_to_string(int version) 
+{
+    Octstr *os;
+    
+    switch (version) {
+        case WSP_1_1:
+            os = octstr_create("1.1");
+            break;
+        case WSP_1_2:
+            os = octstr_create("1.2");
+            break;
+        case WSP_1_3:
+            os = octstr_create("1.3");
+            break;
+        case WSP_1_4:
+            os = octstr_create("1.4");
+            break;
+        case WSP_1_5:
+            os = octstr_create("1.5");
+            break;
+        default:
+            os = octstr_create("1.2");
+            break;
+    }
+    
+    return os;
+}
 
diff -ur --exclude=CVS* old/gateway/wap/wsp_strings.c gateway/wap/wsp_strings.c
--- old/gateway/wap/wsp_strings.c       Thu Jan 18 16:25:06 2001
+++ gateway/wap/wsp_strings.c   Thu Aug  7 17:28:42 2003
@@ -27,31 +27,42 @@
     long size;          /* Nr of entries in each of the tables below */
     Octstr **strings;   /* Immutable octstrs */
     long *numbers;      /* Assigned numbers, or NULL for linear tables */
-    int linear;            /* True for tables defined as LINEAR */
+    int *versions;      /* WSP Encoding-versions, or NULL if non-versioned */
+    int linear;                /* True for tables defined as LINEAR */
 };
 
-struct element
+struct numbered_element
 {
     unsigned char *str;
     long number;
+    int version;    
+};
+
+struct linear_element
+{
+    unsigned char *str;
+    int version;    
 };
 
 /* Local functions */
 static Octstr *number_to_string(long number, struct table *table);
 static unsigned char *number_to_cstr(long number, struct table *table);
 static long string_to_number(Octstr *ostr, struct table *table);
+static long string_to_versioned_number(Octstr *ostr, struct table *table, int 
version);
 
 
 /* Declare the data.  For each table "foo", create a foo_strings array
  * to hold the data, and a (still empty) foo_table structure. */
 #define LINEAR(name, strings) \
-    static const unsigned char *name##_strings[] = { strings }; \
+    static const struct linear_element name##_strings[] = { strings }; \
     static struct table name##_table;
-#define STRING(string) string,
+#define STRING(string) { string, 0 },
+#define VSTRING(version, string) { string, version }, 
 #define NUMBERED(name, strings) \
-    static const struct element name##_strings[] = { strings }; \
+    static const struct numbered_element name##_strings[] = { strings }; \
     static struct table name##_table;
-#define ASSIGN(string, number) { string, number },
+#define ASSIGN(string, number) { string, number, 0 },
+#define VASSIGN(version, string, number) { string, number, version },
 #include "wsp_strings.def"
 
 /* Define the functions for translating number to Octstr */
@@ -74,6 +85,12 @@
 }
 #include "wsp_strings.def"
 
+#define LINEAR(name, strings) \
+long wsp_string_to_versioned_##name(Octstr *ostr, int version) { \
+     return string_to_versioned_number(ostr, &name##_table, version); \
+}
+#include "wsp_strings.def"
+
 static Octstr *number_to_string(long number, struct table *table)
 {
     long i;
@@ -81,13 +98,13 @@
     gw_assert(initialized);
 
     if (table->linear) {
-       if (number >= 0 && number < table->size)
-           return octstr_duplicate(table->strings[number]);
+        if (number >= 0 && number < table->size)
+            return octstr_duplicate(table->strings[number]);
     } else {
-       for (i = 0; i < table->size; i++) {
-            if (table->numbers[i] == number)
-               return octstr_duplicate(table->strings[i]);
-       }
+        for (i = 0; i < table->size; i++) {
+            if (table->numbers[i] == number)
+                return octstr_duplicate(table->strings[i]);
+        }
     }
     return NULL;
 }
@@ -126,34 +143,61 @@
     return -1;
 }
 
-static void construct_linear_table(struct table *table,
-const unsigned char **strings, long size)
+/* Case-insensitive string lookup according to passed WSP encoding version */
+static long string_to_versioned_number(Octstr *ostr, struct table *table, 
+                                       int version)
+{
+    long i, ret;
+
+    gw_assert(initialized);
+
+    /* walk the whole table and pick the highest versioned token */
+    ret = -1;
+    for (i = 0; i < table->size; i++) {
+        if (octstr_case_compare(ostr, table->strings[i]) == 0 &&
+            table->versions[i] <= version) {
+                ret = table->linear ? i : table->numbers[i];
+        }
+    }
+
+    debug("wsp.strings",0,"WSP: Mapping string `%s', WSP version 1.%d to binary " 
+          "representation `0x%04x'.", octstr_get_cstr(ostr), version, ret);
+
+    return ret;
+}
+
+static void construct_linear_table(struct table *table, const struct linear_element 
*strings, 
+                                   long size)
 {
     long i;
 
     table->size = size;
     table->strings = gw_malloc(size * (sizeof table->strings[0]));
     table->numbers = NULL;
+    table->versions = gw_malloc(size * (sizeof table->versions[0]));
     table->linear = 1;
 
     for (i = 0; i < size; i++) {
-       table->strings[i] = octstr_imm(strings[i]);
+        table->strings[i] = octstr_imm(strings[i].str);
+        table->versions[i] = strings[i].version;
     }
 }
 
-static void construct_numbered_table(struct table *table,
-const struct element *strings, long size)
+static void construct_numbered_table(struct table *table, const struct 
numbered_element *strings, 
+                                     long size)
 {
     long i;
 
     table->size = size;
     table->strings = gw_malloc(size * (sizeof table->strings[0]));
     table->numbers = gw_malloc(size * (sizeof table->numbers[0]));
+    table->versions = gw_malloc(size * (sizeof table->versions[0]));
     table->linear = 0;
 
     for (i = 0; i < size; i++) {
-       table->strings[i] = octstr_imm(strings[i].str);
-       table->numbers[i] = strings[i].number;
+        table->strings[i] = octstr_imm(strings[i].str);
+        table->numbers[i] = strings[i].number;
+        table->versions[i] = strings[i].version;
     }
 }
 
@@ -163,6 +207,7 @@
 
     gw_free(table->strings);
     gw_free(table->numbers);
+    gw_free(table->versions);
 }
 
 void wsp_strings_init(void)
diff -ur --exclude=CVS* old/gateway/wap/wsp_strings.def gateway/wap/wsp_strings.def
--- old/gateway/wap/wsp_strings.def     Tue Jun 24 16:32:13 2003
+++ gateway/wap/wsp_strings.def Thu Aug  7 16:30:32 2003
@@ -22,6 +22,11 @@
 #define ASSIGN(string, number) STRING(string)
 #endif
 
+/* Entry in a versioned NUMBERED table */
+#if !defined(VASSIGN)
+#define VASSIGN(version, string, number) VSTRING(version, string)
+#endif
+
 /* Just like LINEAR, but an enumerated type name##_enum is defined for
  * the entries. */
 #if !defined(NAMED)
@@ -33,149 +38,172 @@
 #define NSTRING(string, name) STRING(string)
 #endif
 
+/* Entry in a versioned NAMED table */
+#if !defined(VNSTRING)
+#define VNSTRING(version, string, name) VSTRING(version, string)
+#endif
+
+
 /**** End of preprocessor magic.  Tables start here. ****/
 
 /* Table 39. Header Field Name Assignments. Note that headers Accept-Charset, 
Accept-Encoding,
  * Cache-Control and Content-Range are defined twice. First ones should be used only 
for com-
  * pability reasons. */
 NAMED(header,
-NSTRING("Accept", WSP_HEADER_ACCEPT)
-NSTRING("Accept-Charset", WSP_HEADER_ACCEPT_CHARSET)
-NSTRING("Accept-Encoding", WSP_HEADER_ACCEPT_ENCODING)
-NSTRING("Accept-Language", WSP_HEADER_ACCEPT_LANGUAGE)
-NSTRING("Accept-Ranges", WSP_HEADER_ACCEPT_RANGES)
-NSTRING("Age", WSP_HEADER_AGE)
-NSTRING("Allow", WSP_HEADER_ALLOW)
-NSTRING("Authorization", WSP_HEADER_AUTHORIZATION)
-NSTRING("Cache-Control", WSP_HEADER_CACHE_CONTROL)
-NSTRING("Connection", WSP_HEADER_CONNECTION)
-NSTRING("Content-Base", WSP_HEADER_CONTENT_BASE)
-NSTRING("Content-Encoding", WSP_HEADER_CONTENT_ENCODING)
-NSTRING("Content-Language", WSP_HEADER_CONTENT_LANGUAGE)
-NSTRING("Content-Length", WSP_HEADER_CONTENT_LENGTH)
-NSTRING("Content-Location", WSP_HEADER_CONTENT_LOCATION)
-NSTRING("Content-MD5", WSP_HEADER_CONTENT_MD5)
-NSTRING("Content-Range", WSP_HEADER_CONTENT_RANGE)
-NSTRING("Content-Type", WSP_HEADER_CONTENT_TYPE)
-NSTRING("Date", WSP_HEADER_DATE)
-NSTRING("Etag", WSP_HEADER_ETAG)
-NSTRING("Expires", WSP_HEADER_EXPIRES)
-NSTRING("From", WSP_HEADER_FROM)
-NSTRING("Host", WSP_HEADER_HOST)
-NSTRING("If-Modified-Since", WSP_HEADER_IF_MODIFIED_SINCE)
-NSTRING("If-Match", WSP_HEADER_IF_MATCH)
-NSTRING("If-None-Match", WSP_HEADER_IF_NONE_MATCH)
-NSTRING("If-Range", WSP_HEADER_IF_RANGE)
-NSTRING("If-Unmodified-Since", WSP_HEADER_IF_UNMODIFIED_SINCE)
-NSTRING("Location", WSP_HEADER_LOCATION)
-NSTRING("Last-Modified", WSP_HEADER_LAST_MODIFIED)
-NSTRING("Max-Forwards", WSP_HEADER_MAX_FORWARDS)
-NSTRING("Pragma", WSP_HEADER_PRAGMA)
-NSTRING("Proxy-Authenticate", WSP_HEADER_PROXY_AUTHENTICATE)
-NSTRING("Proxy-Authorization", WSP_HEADER_PROXY_AUTHORIZATION)
-NSTRING("Public", WSP_HEADER_PUBLIC)
-NSTRING("Range", WSP_HEADER_RANGE)
-NSTRING("Referer", WSP_HEADER_REFERER)
-NSTRING("Retry-After", WSP_HEADER_RETRY_AFTER)
-NSTRING("Server", WSP_HEADER_SERVER)
-NSTRING("Transfer-Encoding", WSP_HEADER_TRANSFER_ENCODING)
-NSTRING("Upgrade", WSP_HEADER_UPGRADE)
-NSTRING("User-Agent", WSP_HEADER_USER_AGENT)
-NSTRING("Vary", WSP_HEADER_VARY)
-NSTRING("Via", WSP_HEADER_VIA)
-NSTRING("Warning", WSP_HEADER_WARNING)
-NSTRING("WWW-Authenticate", WSP_HEADER_WWW_AUTHENTICATE)
-NSTRING("Content-Disposition", WSP_HEADER_CONTENT_DISPOSITION)
-NSTRING("X-Wap-Application-Id", WSP_HEADER_X_WAP_APPLICATION_ID)
-NSTRING("X-Wap-Content-URI", WSP_HEADER_X_WAP_CONTENT_URI)
-NSTRING("X-Wap-Initiator-URI", WSP_HEADER_X_WAP_INITIATOR_URI)
-NSTRING("Accept-Application", WSP_HEADER_ACCEPT_APPLICATION)
-NSTRING("Bearer-Indication", WSP_HEADER_BEARER_INDICATION)
-NSTRING("Push-Flag", WSP_HEADER_PUSH_FLAG)
-NSTRING("Profile", WSP_HEADER_PROFILE)
-NSTRING("Profile-Diff", WSP_HEADER_PROFILE_DIFF)
-NSTRING("Profile-Warning", WSP_HEADER_PROFILE_WARNING)
-NSTRING("Expect", WSP_HEADER_EXPECT)
-NSTRING("TE", WSP_HEADER_TE)
-NSTRING("Trailer", WSP_HEADER_TRAILER)
-NSTRING("Accept-Charset", WSP_HEADER_ACCEPT_CHARSET_V13)
-NSTRING("Accept-Encoding", WSP_HEADER_ACCEPT_ENCODING_V13)
-NSTRING("Cache-Control", WSP_HEADER_CACHE_CONTROL_V13)
-NSTRING("Content-Range", WSP_HEADER_CONTENT_RANGE_V13)
-NSTRING("X-WAP-Tod", WSP_HEADER_X_WAP_TOD)
-NSTRING("Content-ID", WSP_HEADER_CONTENT_ID)
-NSTRING("Set-Cookie", WSP_HEADER_SET_COOKIE)
-NSTRING("Cookie", WSP_HEADER_COOKIE)
-NSTRING("Encoding-Version", WSP_HEADER_ENCODING_VERSION)
+VNSTRING(WSP_1_1, "Accept", WSP_HEADER_ACCEPT)
+VNSTRING(WSP_1_1, "Accept-Charset", WSP_HEADER_ACCEPT_CHARSET)
+VNSTRING(WSP_1_1, "Accept-Encoding", WSP_HEADER_ACCEPT_ENCODING)
+VNSTRING(WSP_1_1, "Accept-Language", WSP_HEADER_ACCEPT_LANGUAGE)
+VNSTRING(WSP_1_1, "Accept-Ranges", WSP_HEADER_ACCEPT_RANGES)
+VNSTRING(WSP_1_1, "Age", WSP_HEADER_AGE)
+VNSTRING(WSP_1_1, "Allow", WSP_HEADER_ALLOW)
+VNSTRING(WSP_1_1, "Authorization", WSP_HEADER_AUTHORIZATION)
+VNSTRING(WSP_1_1, "Cache-Control", WSP_HEADER_CACHE_CONTROL)
+VNSTRING(WSP_1_1, "Connection", WSP_HEADER_CONNECTION)
+VNSTRING(WSP_1_1, "Content-Base", WSP_HEADER_CONTENT_BASE)
+VNSTRING(WSP_1_1, "Content-Encoding", WSP_HEADER_CONTENT_ENCODING)
+VNSTRING(WSP_1_1, "Content-Language", WSP_HEADER_CONTENT_LANGUAGE)
+VNSTRING(WSP_1_1, "Content-Length", WSP_HEADER_CONTENT_LENGTH)
+VNSTRING(WSP_1_1, "Content-Location", WSP_HEADER_CONTENT_LOCATION)
+VNSTRING(WSP_1_1, "Content-MD5", WSP_HEADER_CONTENT_MD5)
+VNSTRING(WSP_1_1, "Content-Range", WSP_HEADER_CONTENT_RANGE)
+VNSTRING(WSP_1_1, "Content-Type", WSP_HEADER_CONTENT_TYPE)
+VNSTRING(WSP_1_1, "Date", WSP_HEADER_DATE)
+VNSTRING(WSP_1_1, "Etag", WSP_HEADER_ETAG)
+VNSTRING(WSP_1_1, "Expires", WSP_HEADER_EXPIRES)
+VNSTRING(WSP_1_1, "From", WSP_HEADER_FROM)
+VNSTRING(WSP_1_1, "Host", WSP_HEADER_HOST)
+VNSTRING(WSP_1_1, "If-Modified-Since", WSP_HEADER_IF_MODIFIED_SINCE)
+VNSTRING(WSP_1_1, "If-Match", WSP_HEADER_IF_MATCH)
+VNSTRING(WSP_1_1, "If-None-Match", WSP_HEADER_IF_NONE_MATCH)
+VNSTRING(WSP_1_1, "If-Range", WSP_HEADER_IF_RANGE)
+VNSTRING(WSP_1_1, "If-Unmodified-Since", WSP_HEADER_IF_UNMODIFIED_SINCE)
+VNSTRING(WSP_1_1, "Location", WSP_HEADER_LOCATION)
+VNSTRING(WSP_1_1, "Last-Modified", WSP_HEADER_LAST_MODIFIED)
+VNSTRING(WSP_1_1, "Max-Forwards", WSP_HEADER_MAX_FORWARDS)
+VNSTRING(WSP_1_1, "Pragma", WSP_HEADER_PRAGMA)
+VNSTRING(WSP_1_1, "Proxy-Authenticate", WSP_HEADER_PROXY_AUTHENTICATE)
+VNSTRING(WSP_1_1, "Proxy-Authorization", WSP_HEADER_PROXY_AUTHORIZATION)
+VNSTRING(WSP_1_1, "Public", WSP_HEADER_PUBLIC)
+VNSTRING(WSP_1_1, "Range", WSP_HEADER_RANGE)
+VNSTRING(WSP_1_1, "Referer", WSP_HEADER_REFERER)
+VNSTRING(WSP_1_1, "Retry-After", WSP_HEADER_RETRY_AFTER)
+VNSTRING(WSP_1_1, "Server", WSP_HEADER_SERVER)
+VNSTRING(WSP_1_1, "Transfer-Encoding", WSP_HEADER_TRANSFER_ENCODING)
+VNSTRING(WSP_1_1, "Upgrade", WSP_HEADER_UPGRADE)
+VNSTRING(WSP_1_1, "User-Agent", WSP_HEADER_USER_AGENT)
+VNSTRING(WSP_1_1, "Vary", WSP_HEADER_VARY)
+VNSTRING(WSP_1_1, "Via", WSP_HEADER_VIA)
+VNSTRING(WSP_1_1, "Warning", WSP_HEADER_WARNING)
+VNSTRING(WSP_1_1, "WWW-Authenticate", WSP_HEADER_WWW_AUTHENTICATE)
+VNSTRING(WSP_1_1, "Content-Disposition", WSP_HEADER_CONTENT_DISPOSITION)
+VNSTRING(WSP_1_2, "X-Wap-Application-Id", WSP_HEADER_X_WAP_APPLICATION_ID)
+VNSTRING(WSP_1_2, "X-Wap-Content-URI", WSP_HEADER_X_WAP_CONTENT_URI)
+VNSTRING(WSP_1_2, "X-Wap-Initiator-URI", WSP_HEADER_X_WAP_INITIATOR_URI)
+VNSTRING(WSP_1_2, "Accept-Application", WSP_HEADER_ACCEPT_APPLICATION)
+VNSTRING(WSP_1_2, "Bearer-Indication", WSP_HEADER_BEARER_INDICATION)
+VNSTRING(WSP_1_2, "Push-Flag", WSP_HEADER_PUSH_FLAG)
+VNSTRING(WSP_1_2, "Profile", WSP_HEADER_PROFILE)
+VNSTRING(WSP_1_2, "Profile-Diff", WSP_HEADER_PROFILE_DIFF)
+VNSTRING(WSP_1_2, "Profile-Warning", WSP_HEADER_PROFILE_WARNING)
+VNSTRING(WSP_1_3, "Expect", WSP_HEADER_EXPECT)
+VNSTRING(WSP_1_3, "TE", WSP_HEADER_TE)
+VNSTRING(WSP_1_3, "Trailer", WSP_HEADER_TRAILER)
+VNSTRING(WSP_1_3, "Accept-Charset", WSP_HEADER_ACCEPT_CHARSET_V13)
+VNSTRING(WSP_1_3, "Accept-Encoding", WSP_HEADER_ACCEPT_ENCODING_V13)
+VNSTRING(WSP_1_3, "Cache-Control", WSP_HEADER_CACHE_CONTROL_V13)
+VNSTRING(WSP_1_3, "Content-Range", WSP_HEADER_CONTENT_RANGE_V13)
+VNSTRING(WSP_1_3, "X-WAP-Tod", WSP_HEADER_X_WAP_TOD)
+VNSTRING(WSP_1_3, "Content-ID", WSP_HEADER_CONTENT_ID)
+VNSTRING(WSP_1_3, "Set-Cookie", WSP_HEADER_SET_COOKIE)
+VNSTRING(WSP_1_3, "Cookie", WSP_HEADER_COOKIE)
+VNSTRING(WSP_1_3, "Encoding-Version", WSP_HEADER_ENCODING_VERSION)
+VNSTRING(WSP_1_4, "Profile-Warning", WSP_HEADER_PROFILE_WARNING_V14)
+VNSTRING(WSP_1_4, "Content-Disposition", WSP_HEADER_CONTENT_DISPOSITION_V14)
+VNSTRING(WSP_1_4, "X-WAP-Security", WSP_HEADER_X_WAP_SECURITY)
+VNSTRING(WSP_1_4, "Cache-Control", WSP_HEADER_CACHE_CONTROL_V14)
 )
 
-/* Table 40. Content Type Assignments. Only to wsp version 1.3. */
+/* Table 40. Content Type Assignments. These are defined by WINA, 
+ * see http://www.wapforum.org/wina/wsp-content-type.htm 
+ */
 LINEAR(content_type,
-STRING("*/*")
-STRING("text/*")
-STRING("text/html")
-STRING("text/plain")
-STRING("text/x-hdml")
-STRING("text/x-ttml")
-STRING("text/x-vCalendar")
-STRING("text/x-vCard")
-STRING("text/vnd.wap.wml")
-STRING("text/vnd.wap.wmlscript")
-STRING("application/vnd.wap.catc")
-STRING("multipart/*")
-STRING("multipart/mixed")
-STRING("multipart/form-data")
-STRING("multipart/byteranges")
-STRING("multipart/alternative")
-STRING("application/*")
-STRING("application/java-vm")
-STRING("application/x-www-form-urlencoded")
-STRING("application/x-hdmlc")
-STRING("application/vnd.wap.wmlc")
-STRING("application/vnd.wap.wmlscriptc")
-STRING("application/vnd.wap.wsic")
-STRING("application/vnd.wap.uaprof")
-STRING("application/vnd.wap.wtls-ca-certificate")
-STRING("application/vnd.wap.wtls-user-certificate")
-STRING("application/x-x509-ca-cert")
-STRING("application/x-x509-user-cert")
-STRING("image/*")
-STRING("image/gif")
-STRING("image/jpeg")
-STRING("image/tiff")
-STRING("image/png")
-STRING("image/vnd.wap.wbmp")
-STRING("application/vnd.wap.multipart.*")
-STRING("application/vnd.wap.multipart.mixed")
-STRING("application/vnd.wap.multipart.form-data")
-STRING("application/vnd.wap.multipart.byteranges")
-STRING("application/vnd.wap.multipart.alternative")
-STRING("application/xml")
-STRING("text/xml")
-STRING("application/vnd.wap.wbxml")
-STRING("application/x-x968-cross-cert")
-STRING("application/x-x968-ca-cert")
-STRING("application/x-x968-user-cert")
-STRING("text/vnd.wap.si")
-STRING("application/vnd.wap.sic")
-STRING("text/vnd.wap.sl")
-STRING("application/vnd.wap.slc")
-STRING("text/vnd.wap.co")
-STRING("application/vnd.wap.coc")
-STRING("application/vnd.wap.multipart.related")
-STRING("application/vnd.wap.sia")
-STRING("text/vnd.wap.connectivity-xml")
-STRING("application/vnd.wap.connectivity-wbxml")
-/*
-STRING("application/pkcs7-mime")
-STRING("application/vnd.wap.hashed-certificate")
-STRING("application/vnd.wap.signed-certificate")
-STRING("application/vnd.wap.cert-response")
-STRING("application/xhtml+xml")
-STRING("application/wml+xml")
-STRING("text/css")
-STRING("application/vnd.wap.mms-message")
-*/ 
+VSTRING(WSP_1_1, "*/*")
+VSTRING(WSP_1_1, "text/*")
+VSTRING(WSP_1_1, "text/html")
+VSTRING(WSP_1_1, "text/plain")
+VSTRING(WSP_1_1, "text/x-hdml")
+VSTRING(WSP_1_1, "text/x-ttml")
+VSTRING(WSP_1_1, "text/x-vCalendar")
+VSTRING(WSP_1_1, "text/x-vCard")
+VSTRING(WSP_1_1, "text/vnd.wap.wml")
+VSTRING(WSP_1_1, "text/vnd.wap.wmlscript")
+VSTRING(WSP_1_1, "application/vnd.wap.catc")
+VSTRING(WSP_1_1, "multipart/*")
+VSTRING(WSP_1_1, "multipart/mixed")
+VSTRING(WSP_1_1, "multipart/form-data")
+VSTRING(WSP_1_1, "multipart/byteranges")
+VSTRING(WSP_1_1, "multipart/alternative")
+VSTRING(WSP_1_1, "application/*")
+VSTRING(WSP_1_1, "application/java-vm")
+VSTRING(WSP_1_1, "application/x-www-form-urlencoded")
+VSTRING(WSP_1_1, "application/x-hdmlc")
+VSTRING(WSP_1_1, "application/vnd.wap.wmlc")
+VSTRING(WSP_1_1, "application/vnd.wap.wmlscriptc")
+VSTRING(WSP_1_1, "application/vnd.wap.wsic")
+VSTRING(WSP_1_1, "application/vnd.wap.uaprof")
+VSTRING(WSP_1_1, "application/vnd.wap.wtls-ca-certificate")
+VSTRING(WSP_1_1, "application/vnd.wap.wtls-user-certificate")
+VSTRING(WSP_1_1, "application/x-x509-ca-cert")
+VSTRING(WSP_1_1, "application/x-x509-user-cert")
+VSTRING(WSP_1_1, "image/*")
+VSTRING(WSP_1_1, "image/gif")
+VSTRING(WSP_1_1, "image/jpeg")
+VSTRING(WSP_1_1, "image/tiff")
+VSTRING(WSP_1_1, "image/png")
+VSTRING(WSP_1_1, "image/vnd.wap.wbmp")
+VSTRING(WSP_1_1, "application/vnd.wap.multipart.*")
+VSTRING(WSP_1_1, "application/vnd.wap.multipart.mixed")
+VSTRING(WSP_1_1, "application/vnd.wap.multipart.form-data")
+VSTRING(WSP_1_1, "application/vnd.wap.multipart.byteranges")
+VSTRING(WSP_1_1, "application/vnd.wap.multipart.alternative")
+VSTRING(WSP_1_1, "application/xml")
+VSTRING(WSP_1_1, "text/xml")
+VSTRING(WSP_1_1, "application/vnd.wap.wbxml")
+VSTRING(WSP_1_1, "application/x-x968-cross-cert")
+VSTRING(WSP_1_1, "application/x-x968-ca-cert")
+VSTRING(WSP_1_1, "application/x-x968-user-cert")
+VSTRING(WSP_1_1, "text/vnd.wap.si")
+VSTRING(WSP_1_2, "application/vnd.wap.sic")
+VSTRING(WSP_1_2, "text/vnd.wap.sl")
+VSTRING(WSP_1_2, "application/vnd.wap.slc")
+VSTRING(WSP_1_2, "text/vnd.wap.co")
+VSTRING(WSP_1_2, "application/vnd.wap.coc")
+VSTRING(WSP_1_2, "application/vnd.wap.multipart.related")
+VSTRING(WSP_1_2, "application/vnd.wap.sia")
+VSTRING(WSP_1_3, "text/vnd.wap.connectivity-xml")
+VSTRING(WSP_1_3, "application/vnd.wap.connectivity-wbxml")
+VSTRING(WSP_1_4, "application/pkcs7-mime")
+VSTRING(WSP_1_4, "application/vnd.wap.hashed-certificate")
+VSTRING(WSP_1_4, "application/vnd.wap.signed-certificate")
+VSTRING(WSP_1_4, "application/vnd.wap.cert-response")
+VSTRING(WSP_1_4, "application/xhtml+xml")
+VSTRING(WSP_1_4, "application/wml+xml")
+VSTRING(WSP_1_4, "text/css")
+VSTRING(WSP_1_4, "application/vnd.wap.mms-message")
+VSTRING(WSP_1_4, "application/vnd.wap.rollover-certificate")
+VSTRING(WSP_1_5, "application/vnd.wap.locc+wbxml") 
+VSTRING(WSP_1_5, "application/vnd.wap.loc+xml")
+VSTRING(WSP_1_5, "application/vnd.syncml.dm+wbxml") 
+VSTRING(WSP_1_5, "application/vnd.syncml.dm+xml") 
+VSTRING(WSP_1_5, "application/vnd.syncml.notification") 
+VSTRING(WSP_1_5, "application/vnd.wap.xhtml+xml") 
+VSTRING(WSP_1_5, "application/vnd.wv.csp.cir") 
+VSTRING(WSP_1_5, "application/vnd.oma.dd+xml") 
+VSTRING(WSP_1_5, "application/vnd.oma.drm.message") 
+VSTRING(WSP_1_5, "application/vnd.oma.drm.content")
+VSTRING(WSP_1_5, "application/vnd.oma.drm.rights+xml") 
+VSTRING(WSP_1_5, "application/vnd.oma.drm.rights+wbxml") 
 )
 
 /* Table 42, Character Set Assignment (partial) */
@@ -202,22 +230,35 @@
 
 /* Table 38, Well-Known Parameter Assignments */
 NUMBERED(parameter,
-ASSIGN("q", 0)
-ASSIGN("charset", 1)
-ASSIGN("level", 2)
-ASSIGN("type", 3)
-ASSIGN("name", 5)
-ASSIGN("filename", 6)
-ASSIGN("differences", 7)
-ASSIGN("padding", 8)
-ASSIGN("type", 9)
-ASSIGN("start", 10)
-ASSIGN("start-info", 11)
-ASSIGN("comment", 12)
-ASSIGN("domain", 13)
-ASSIGN("max-age", 14)
-ASSIGN("path", 15)
-ASSIGN("secure", 16)
+VASSIGN(WSP_1_1, "q", 0)
+VASSIGN(WSP_1_1, "charset", 1)
+VASSIGN(WSP_1_1, "level", 2)
+VASSIGN(WSP_1_1, "type", 3)
+VASSIGN(WSP_1_1, "name", 5)
+VASSIGN(WSP_1_1, "filename", 6)
+VASSIGN(WSP_1_1, "differences", 7)
+VASSIGN(WSP_1_1, "padding", 8)
+VASSIGN(WSP_1_2, "type", 9)
+VASSIGN(WSP_1_2, "start", 10)
+VASSIGN(WSP_1_2, "start-info", 11)
+VASSIGN(WSP_1_3, "comment", 12)
+VASSIGN(WSP_1_3, "domain", 13)
+VASSIGN(WSP_1_3, "max-age", 14)
+VASSIGN(WSP_1_3, "path", 15)
+VASSIGN(WSP_1_3, "secure", 16)
+VASSIGN(WSP_1_4, "sec", 17)
+VASSIGN(WSP_1_4, "mac", 18)
+VASSIGN(WSP_1_4, "creation-date", 19)
+VASSIGN(WSP_1_4, "modification-date", 20)
+VASSIGN(WSP_1_4, "read-date", 21)
+VASSIGN(WSP_1_4, "size", 22)
+VASSIGN(WSP_1_4, "name", 23)
+VASSIGN(WSP_1_4, "filename", 24)
+VASSIGN(WSP_1_4, "start", 25)
+VASSIGN(WSP_1_4, "start-info", 26)
+VASSIGN(WSP_1_4, "comment", 27)
+VASSIGN(WSP_1_4, "domain", 28)
+VASSIGN(WSP_1_4, "path", 29)
 )
 
 /* 8.4.2.18, Content encoding field */
@@ -489,7 +530,11 @@
 
 #undef LINEAR
 #undef STRING
+#undef VSTRING
 #undef NUMBERED
 #undef ASSIGN
+#undef VASSIGN
 #undef NAMED
 #undef NSTRING
+#undef VNSTRING
+
diff -ur --exclude=CVS* old/gateway/wap/wsp_strings.h gateway/wap/wsp_strings.h
--- old/gateway/wap/wsp_strings.h       Mon Nov 20 20:55:54 2000
+++ gateway/wap/wsp_strings.h   Thu Aug  7 16:10:30 2003
@@ -28,6 +28,7 @@
 #define WSP_STRINGS_H
 
 #include "gwlib/gwlib.h"
+#include "wap/wsp.h"
 
 /* Must be called before any of the other functions in this file.
  * Can be called more than once, in which case multiple shutdowns
@@ -50,6 +51,7 @@
 #define STRING(string)
 #define NAMED(name, strings) enum name##_enum { strings name##_dummy };
 #define NSTRING(string, name) name,
+#define VNSTRING(version, string, name) name,
 #include "wsp_strings.def"
 
 #endif
diff -ur --exclude=CVS* old/gateway/wap/wsp_unit.c gateway/wap/wsp_unit.c
--- old/gateway/wap/wsp_unit.c  Thu Jun 19 14:30:54 2003
+++ gateway/wap/wsp_unit.c      Thu Aug  7 17:05:06 2003
@@ -209,11 +209,11 @@
        gw_assert(event->type == S_Unit_MethodResult_Req);
        p = &event->u.S_Unit_MethodResult_Req;
 
-        http_header_add(p->response_headers, "Encoding-Version", "1.3");
+    http_header_add(p->response_headers, "Encoding-Version", "1.3");
 
        pdu = wsp_pdu_create(Reply);
        pdu->u.Reply.status = wsp_convert_http_status_to_wsp_status(p->status);
-       pdu->u.Reply.headers = wsp_headers_pack(p->response_headers, 1);
+       pdu->u.Reply.headers = wsp_headers_pack(p->response_headers, 1, WSP_1_3);
        pdu->u.Reply.data = octstr_duplicate(p->response_body);
        ospdu = wsp_pdu_pack(pdu);
        wsp_pdu_destroy(pdu);
@@ -249,7 +249,7 @@
 
         pdu = wsp_pdu_create(Push);
        pdu->u.Push.headers = wsp_headers_pack(
-            event->u.S_Unit_Push_Req.push_headers, 1);
+            event->u.S_Unit_Push_Req.push_headers, 1, WSP_1_3);
        pdu->u.Push.data = octstr_duplicate(
             event->u.S_Unit_Push_Req.push_body);
         ospdu = wsp_pdu_pack(pdu);

Reply via email to