Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2003

    What is contained in the data packet of a WAP redirect method result

    Executing an Open() transaction on some WAP gateways results in a ERedirect_ind_s method returning. This is clearly a method of load balancing the requests to the WAP server.

    However, what is the format of the data returned? On all WAP gateways I have tried I get 8 bytes which is clearly composed of 2 IP addresses.

    However, on one gateway (devgate2.openwave.com) the 2nd IP address is the same as the one redirecting. The 1st IP address is a valid WAP server that responds fine.

    On another (the O2 WAP gateway, UK), the 1st IP address doesn't respond to WAP requests but the 2nd does. Both are different from the redirecting WAP server.

    What is the protocol? Which address should be used?

  2. #2
    Registered User
    Join Date
    May 2003
    I'll answer my own question. The 8 bytes are part of the WAP specification for a redirect response from a WAP gateway. The first 2 bytes contain various flags. The second two contain a UDP port number and the final 4 contain an IP address. The idea is that you open the server at the specified address and port. The flags determine i) if a port is specified, ii) if an IP address is specified and iii) some other stuff that didn't look very interesting. If you fetch wap pages from a carrier's gateway, you will probably be redirected thus.

  3. #3
    Regular Contributor
    Join Date
    Apr 2003

    How to handle RWSPCOConn::ERedirect_ind_s

    I also did some investigation on the topic. For those you might have the same trouble, in case you get a RWSPCOConn::ERedirect_ind_s call:

    RWSPCOConn::GetSessionData( buffer, RWSPCOConn::ERedirectAddresses )

    The Data returned by GetSessionData can be converted to TRedirectData:

    struct TRedirectAddressFlags
    TUint8 l_U8_AddressOctetCount : 6;
    TUint8 l_U8_PortNumberSpecified : 1; /* Is a port number supplied?*/
    TUint8 l_U8_BearerTypeSpecified : 1;
    } __attribute__ ((packed));

    struct TRedirectData
    TRedirectAddressFlags l_TFlags;
    TUint8 l_U8_BearerType;
    TUint8 l_U8_PortNumberHigh;
    TUint8 l_U8_PortNumberLow;
    /* TUint8 l_U8_Octets[]; l_TFlags.l_U8_AddressOctetCount bytes; usually 4 for an IP address*/
    TUint16 GetPortNumber( ) { return ( l_U8_PortNumberHigh << 8 ) | l_U8_PortNumberLow; }
    } __attribute__ ((packed));

    With this information you can now reconnect your WAP connection.

    For more information search the PDFs about WAP 1.2 on www.wapforum.org .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts