[8525, TyTN, MDA Vario II, JasJam General] HB_TyTN:
About networks

The network thing in Windows Mobile seems pretty messed up. In an attempt to make things easier, safer and more automated, I think, Microsoft left anybody on the way.

Here is what I understand and (warning), I may be totally off.

There are four pre-defined networks Internet, Corp, WAP and Secure WAP.

Although those may have different names based on OS language and HTC, provider or user choosing, the IDs of these networks are fixed and can be looked up in the SDK/include/connmgr.h file. E.g. Internet, is identified by 436EF144-B4FB-4863-A041-8F905A62C572.

These networks describe different setups in terms of routing, security or proxy settings or are used from different applications (e.g. WAP/MMS).

Of all networks, one is selected as Internet (public) and another can be chosen as private under Select Networks in Advanced Connections.

Internet will provide TCP/IP only. Private will provide access to Windows shares, and may connect to the internet, usually thru a proxy.

The Connection Manager separates the world into Internet and private, based on the URL of the server.

Non local server names, e.g. www.xda-developers.com will be connected with the network specfied as Internet.

Yes, this includes any directly entered IP address, as the detection is based on the occurrence of a "." dot in the server name. The only way around this is to specify the URL in Settings, Connections, Advanced, Exceptions (using * as a wildcard if necessary).

Sole server names and except URLs will be connected thru the network designated as private.

With each network, connections, network cards and wireless networks can be associated, so that, finally, the connection manager uses or dials one of those connections based on the network it chose to use.

That's a long intro into lesson #3: Querying network information

I'll start resetting RAPI security to restricted, by copying RapiRestricted.cpf to the device, running it and checking the SMS message for success. This should prevent any actual messing up something.

Now to querying networks using the CM_Networks configuration provider.

<!-- query.xml>

<!--<!DOCTYPE wap-provisioningdoc SYSTEM "msprov.dtd">-->

<wap-provisioningdoc>

<characteristic-query type="CM_Networks" recursive="TRUE"/>

</wap-provisioningdoc>

C:\>rapiconfig /p query.xml

C:\>notepad RapiConfigOut.xml

The introduction above is to explain why this query does not reveal anything useful, other than a list network names, their ID and an obscure "Secure" value, which is 0 for all my connections.

I find it more interesting to query the CM_PPPEntries or the CM_GPRSEntries providers. They use a similar, yet somewhat convoluted schema.

Here are the notable parts:

DestID associates the entry with one of the networks I talked about and queried above.

Phone is the number to dial for the connection. For GPRS, this entry is set to "~GPRS!". I wonder who came up with that string.

Username and Password are obvious and so is RequirePw.

DnsAddr, AltDnsAddr are not out of the ordinary, and if SpecificIpAddr is "1", the ip address is in IpAddr, although I'd assume it is assigned dynamically in most cases.

DeviceType and DeviceName are set to "modem" and "Cellular Line" for the connections that use the phone network.

DeviceSpecificRAW is the most dangerous entry here, since it contains the parameters for the phone device in binary form. I wonder if there is any point in looking into those other than to inflict pain.

Some of the device parameters are set verbosely, so let's rather look at those. However, your provider may not like it if you modify these vigorously.

If BearerInfoValid is 1, BearerInfoService and BearerInfoSpeed are supposed to specify the type of modem and it's speed. Values in my case are 1 -Async Modem and 15 - 9600 v32, which goes to show that the latter value is rather useless, because I know I get more than that with both UMTS and GPRS. So better not tamper with these.

CompressionInfoValid and RadioLinkInfoValid are set to 0 in my case, so one can easily do without.

GRPSInfoValid is set to 1, but the only real interesting parameter is GPRSInfoAccessPointName, which must be set for the GPRS connection to know whom to talk to.

GPRSInfoQOSSettingsValid and GPRSInfoMinQOSSettingsValid are 0, which is sad, because I'm really not happy with my GPRS Quality of Service and would have loved to improve it.

Now, that was a joke. QoS is a way of classifying network traffic for bandwidth and latency and I doubt any provider supports it for Joe Average.

For all the parameters documentation is in the Smartphone SDK about the Telephony and TSP API structures.

Finally, a list of default URL mappings, as found in the CM_Mapping provider documentation.

*://*.*/* The Internet

*://*/* My Corporate Network

wsp://*/* WAP Network

wsps://*/* Secure WAP Network

To query my personalization settings, next time I'll dive into the registry and see what I can do with RAPI configuration queries.