Channels
[Connection Manager]


Detailed Description

The application connectivity API.


Availability constants

#define ALP_CNC_AVAILABILITY_NO   255
 profile is not available
#define ALP_CNC_AVAILABILITY_PERCENT_BASE   100
 100 to 200: signal strength
#define ALP_CNC_AVAILABILITY_UNKNOWN   0
 profile availability is unknown
#define ALP_CNC_AVAILABILITY_YES   1
 profile is available

Kind of disconnection/cancel

#define ALP_CNC_CANCEL_CHANNEL   ((uint8_t) 0x80)
 Cancel the channel (no other connection attempt).
#define ALP_CNC_CANCELLED_SYSTEM   ((uint8_t) 2)
 Channel connection was cancelled by the system.
#define ALP_CNC_CANCELLED_USER   ((uint8_t) 1)
 Channel connection was cancelled by the user.
#define ALP_CNC_DISCONNECT_WITH_TIMEOUT   ((uint8_t) 0x40)
 Use a pre-defined disconnection timeout.
#define ALP_CNC_DISCONNECTED_SYSTEM   ((uint8_t) 4)
 Channel connection was disconnected by system.
#define ALP_CNC_DISCONNECTED_TIMEOUT   ((uint8_t) 5)
 Channel connection was disconnected by system on timeout.
#define ALP_CNC_DISCONNECTED_USER   ((uint8_t) 3)
 Channel connection was disconnected by user.
#define ALP_CNC_FLAG_MASK   ((uint8_t) 0x3F)
 Disconnection Flags mask.
#define ALP_CNC_NOT_CANCELLED   ((uint8_t) 0)
 Channel was not cancelled/disconnected.

Link parameter values

See ALP_NET_CNC_CONFIGURATION

#define ALP_CNC_CHANNEL_LINK_BLUETOOTH   0x00000040
 Bluetooth profile.
#define ALP_CNC_CHANNEL_LINK_CS   0x00000002
 Data call circuit switch profile.
#define ALP_CNC_CHANNEL_LINK_ETHERNET   0x00000100
 Ethernet profile.
#define ALP_CNC_CHANNEL_LINK_IPV6OVERIPV4   0x00000200
 IPv6 over IPv4.
#define ALP_CNC_CHANNEL_LINK_PS   0x00000001
 Data call packet switch profile.
#define ALP_CNC_CHANNEL_LINK_PS_IP   0x00000008
 IP direct data call packet switch profile.
#define ALP_CNC_CHANNEL_LINK_USB   0x00000080
 USB Ethernet profile.
#define ALP_CNC_CHANNEL_LINK_WIFI   0x00000020
 WIFI profile.
#define ALP_CNC_CHANNEL_LINK_WIN_RAS   0x00000400
 PPP over serial.

Service parameter values

See ALP_NET_CNC_CONFIGURATION

#define ALP_CNC_CHANNEL_SRV_BACKGROUND   0x20000000
 Internal use.
#define ALP_CNC_CHANNEL_SRV_DM   0x00000200
 DM profile.
#define ALP_CNC_CHANNEL_SRV_EMAIL   0x00000008
 EMAIL able profile.
#define ALP_CNC_CHANNEL_SRV_GENERIC   0x10000000
 generic Internet profile
#define ALP_CNC_CHANNEL_SRV_IM   0x00000020
 IM able profile.
#define ALP_CNC_CHANNEL_SRV_MMS   0x00000002
 MMS able profile.
#define ALP_CNC_CHANNEL_SRV_PTT   0x00000040
 PTT able profile.
#define ALP_CNC_CHANNEL_SRV_SHAREABLE   0x00000100
 Shareable profile.
#define ALP_CNC_CHANNEL_SRV_SIP   0x00000010
 SIP able profile.
#define ALP_CNC_CHANNEL_SRV_SYNC   0x00000080
 SYNC able profile.
#define ALP_CNC_CHANNEL_SRV_WAP   0x00000001
 WAP able profile.
#define ALP_CNC_CHANNEL_SRV_WEB   0x00000004
 WEB able profile.

Connect options

#define ALP_CNC_CONNECT_ABORTED   512
 (internal use) Aborted profile
#define ALP_CNC_CONNECT_ALLOWED   8192
 (internal use) Set when an allowed application open a channel (no need to ask user)
#define ALP_CNC_CONNECT_ASK_USER   4096
 (internal use) Sent when need to ask user in the connection process
#define ALP_CNC_CONNECT_BACKGROUND   65536
 Background connection.
#define ALP_CNC_CONNECT_CHOOSER_UI   2
 Ask user the profile to callback to.
#define ALP_CNC_CONNECT_DISABLE_FALLBACK   4
 Disable fallback mechanism.
#define ALP_CNC_CONNECT_DISABLE_RECONNECTION   8
 Disable auto-reconnnection mechanism.
#define ALP_CNC_CONNECT_END   128
 (internal use) Connection ends
#define ALP_CNC_CONNECT_PASSWORD_REQUIRED   16384
 (internal use) Set when a password prompt is required now for connecting the channel
#define ALP_CNC_CONNECT_PERSISTENT   256
 Persistent (network) channels are marked persistent after connection.
#define ALP_CNC_CONNECT_PLUGIN_UI   32768
 (internal use) Set when an UI input is required now for connecting the channel
#define ALP_CNC_CONNECT_PROGRESS_UI   1
 Display progress UI.
#define ALP_CNC_CONNECT_SERVER_ASYNCHRONOUS   32
 Connect asynchronously (server mode, from a plug-in).
#define ALP_CNC_CONNECT_SERVER_WRITE_FD   64
 (internal use) Write fd to client (server only)
#define ALP_CNC_CONNECT_SHARED   1024
 Shared profile (initiated by an external request).
#define ALP_CNC_CONNECT_SYNCHRONOUS   16
 Connect synchronously.
#define ALP_CNC_CONNECT_TUNNEL   2048
 Connect a tunneled connection.

Fake file descriptor for network connections

#define ALP_CNC_CONNECTION_FAKE_FD   0x7FFFFFFF
 Fake fd when connection does not return a real fd.

Predefined control requests

#define ALP_CNC_CONTROL_AVAILABILITY   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000006)
 Control request to ask a profile availability.
#define ALP_CNC_CONTROL_BIND_DESTINATION   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000007)
 Control to add a destination rule in the IP route table.
#define ALP_CNC_CONTROL_BUILTIN_CLASS   ((uint32_t) 0x00000000)
 Class for builtin controls.
#define ALP_CNC_CONTROL_CABLE_DETECTION   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x0000000F)
 Control used to associate an action on a profile with events on a cable.
#define ALP_CNC_CONTROL_DECONFIGURE   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000013)
 Deconfigure TCP/IP settings.
#define ALP_CNC_CONTROL_DISCONNECT   (ALP_CNC_CONTROL_BUILTIN_CLASS | ALP_CNC_CONTROL_RECURSIVE|((uint32_t) 0x00000003))
 Control sent to a profile to disconnect it.
#define ALP_CNC_CONTROL_GET_DATA   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000009)
 Control used by VPN plug-ins to discuss with the VPN framework.
#define ALP_CNC_CONTROL_ITEM_CHANGED   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000002)
 Control sent to a plug-in when a new profile is attached to it.
#define ALP_CNC_CONTROL_LOWERS_ONLY   ((uint32_t) 0x40000000)
 Mask for control that only applies to lower plug-ins.
#define ALP_CNC_CONTROL_NET_ACCESS_CONNECTED   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x0000000E)
 Control used when a profile containing NetAccess is connected.
#define ALP_CNC_CONTROL_NETIN_DOWN   (ALP_CNC_CONTROL_BUILTIN_CLASS | (ALP_CNC_CONTROL_RECURSIVE)|(uint32_t) 0x0000000B)
 Control used by Netin framework when a new interface comes down.
#define ALP_CNC_CONTROL_NETIN_UP   (ALP_CNC_CONTROL_BUILTIN_CLASS | (ALP_CNC_CONTROL_RECURSIVE)|(uint32_t) 0x0000000A)
 Control used by Netin framework when a new interface comes up.
#define ALP_CNC_CONTROL_NETOUT_ABORT   (ALP_CNC_CONTROL_BUILTIN_CLASS | ALP_CNC_CONTROL_LOWERS_ONLY | ALP_CNC_CONTROL_RECURSIVE | ((uint32_t) 0x0000000C))
 Control used by connecting profiles to abort lower plug-ins.
#define ALP_CNC_CONTROL_NETOUT_DOWN   (ALP_CNC_CONTROL_BUILTIN_CLASS | ALP_CNC_CONTROL_RECURSIVE | ((uint32_t) 0x0000000D))
 Control used when link becomes down because of an external event (i.e. pppd exits).
#define ALP_CNC_CONTROL_PRIORITY   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000001)
 Control request to define profile priority (at creation time).
#define ALP_CNC_CONTROL_RECONFIGURE   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000012)
 Reconfigure TCP/IP settings.
#define ALP_CNC_CONTROL_RECURSIVE   ((uint32_t) 0x80000000)
 Mask for recursive control.
#define ALP_CNC_CONTROL_RESUME   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000011)
 Resume a profile.
#define ALP_CNC_CONTROL_SUSPEND   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000010)
 Suspend a profile.
#define ALP_CNC_CONTROL_TEST   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000004)
 Control sent to a profile to test it.
#define ALP_CNC_CONTROL_UNBIND_DESTINATION   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000008)
 Control to delete a destination rule in the IP route table.
#define ALP_CNC_CONTROL_USER_CHANGE   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000005)
 Control sent to a profile when the user made changes to it.

Progress callback sub-functions

#define ALP_CNC_PROGRESS_CHOOSER   2
 ask user for next profile to connect
#define ALP_CNC_PROGRESS_FINI   3
 finalize progress
#define ALP_CNC_PROGRESS_INIT   0
 initialize progress
#define ALP_CNC_PROGRESS_UPDATE   1
 update progress

Connection state constants used in AlpCncChannel.state

#define ALP_CNC_STATE_CONNECTED   ((uint8_t) 0x01)
 Channel is connected.
#define ALP_CNC_STATE_CONNECTING   ((uint8_t) 0x02)
 Channel is connecting.
#define ALP_CNC_STATE_DISCONNECTED   ((uint8_t) 0x04)
 Channel is disconnected (was connected/connecting and became disconnnected).
#define ALP_CNC_STATE_DISCONNECTING   ((uint8_t) 0x08)
 Channel is disconnecting.
#define ALP_CNC_STATE_FINAL   (ALP_CNC_STATE_CONNECTED | ALP_CNC_STATE_DISCONNECTED | ALP_CNC_STATE_SUSPENDED)
 channel stable states
#define ALP_CNC_STATE_NOT_CONNECTED   ((uint8_t) 0x20)
 Channel is not connected (has never been connected).
#define ALP_CNC_STATE_SUSPENDED   ((uint8_t) 0x10)
 Channel is suspended.
#define ALP_CNC_STATE_UNKNOWN   ((uint8_t) 0x00)
 reserved

Notifications

#define ALP_NOTIFY_APP_ID_CNC_SERVER   "cncd"
 Notification app id of connection manager server.
#define ALP_NOTIFY_EVENT_CNC_AVAILABILITY   "/alp/cnc/availability"
 Notification eventually sent by a transport when it becomes available.
#define ALP_NOTIFY_EVENT_CNC_CONNECTION   "/alp/cnc/connection"
 Notification sent by cncd when a profile is connected or disconnected.

Application connectivity API

alp_status_t alp_cnc_channel_add_service (uint8_t chan_id, uint32_t service)
alp_status_t alp_cnc_channel_close (uint8_t chan_id, uint8_t reason)
alp_status_t alp_cnc_channel_connect (uint8_t chan_id)
alp_status_t alp_cnc_channel_create (char *tags, uint32_t flags, uint8_t *chan_id)
alp_status_t alp_cnc_channel_create_id (uint32_t profile_id, uint32_t flags, uint8_t *chan_id)
alp_status_t alp_cnc_channel_destroy (uint8_t chan_id)
alp_status_t alp_cnc_channel_disconnect (uint8_t chan_id, uint8_t reason)
AlpCncChannelalp_cnc_channel_get (uint8_t chan_id, alp_status_t *status)
alp_status_t alp_cnc_channel_open (char *tags, uint32_t flags, uint8_t *chan_id)
alp_status_t alp_cnc_channel_open_id (uint32_t profile_id, uint32_t flags, uint8_t *chan_id)
alp_status_t alp_cnc_channel_select (uint8_t chan_id)
alp_status_t alp_cnc_channel_set_default (char *tags, uint32_t default_id)
alp_status_t alp_cnc_channel_set_profiles (uint8_t chan_id, uint8_t count, uint32_t *listP)
alp_status_t alp_cnc_channel_set_proxies (uint8_t chan_id, uint8_t count, uint32_t *listP)
AlpCncChannelalp_cnc_channel_wait (alp_status_t *status)

Priviligied connectivity API

alp_status_t alp_cnc_channel_get_owner (uint8_t channel_id, pid_t *pidP)
alp_status_t alp_cnc_object_control (uint32_t objectId, uint32_t request, AlpCncControl *controlP)
alp_status_t alp_cnc_profile_connect (uint32_t profileId, uint32_t flags, int *fd)
alp_status_t alp_cnc_profile_disconnect (uint32_t profileId, uint8_t reason)
alp_status_t alp_cnc_profile_get_clients (uint32_t profileId, uint8_t *pidCountP, pid_t **pidListP)

New libc network API

hostent * alp_cnc_gethostbyname (const char *name)
int alp_cnc_socket (int domain, int type, int protocol)
int alp_cnc_unbound_socket (int domain, int type, int protocol)

Connection mechanisms

alp_status_t alp_cnc_job_end (uint32_t jobId, int nbArgs, char **args)
alp_status_t alp_cnc_job_end_fini (int fd, int nbArgs, char **args)
int alp_cnc_job_end_init (uint32_t jobId)

Defines

#define ALP_CNC_ICON_NAME_MAX_SIZE   64

Typedefs

typedef _AlpCncChannel AlpCncChannel
 Channel definition.
typedef _AlpCncChannelProfile AlpCncChannelProfile
 Channel profile information.
typedef _AlpCncControl AlpCncControl
 definition
typedef _AlpCncControlAvailability AlpCncControlAvailability
 the availability control type
typedef _AlpCncControlBindDestination AlpCncControlBindDestination
 the bind destination control type
typedef _AlpCncControlCableDetection AlpCncControlCableDetection
 the cable detection control type
typedef _AlpCncControlNetin AlpCncControlNetin
 the type used in NETIN_xxxx controls
typedef _AlpCncControlReconfigure AlpCncControlReconfigure
 the reconfigure control
typedef void *() AlpCncProgressCallback (int request, void *data, void *u_data)
typedef _AlpNotifyEventCncAvailability AlpNotifyEventCncAvailability
 the type used in the availability notification
typedef _AlpNotifyEventCncConnection AlpNotifyEventCncConnection
 the type used in the connection notification

Variables

AlpCncProgressCallbackgcnc_progress
 Progress callback global.


Define Documentation

#define ALP_CNC_AVAILABILITY_NO   255
 

profile is not available

#define ALP_CNC_AVAILABILITY_PERCENT_BASE   100
 

100 to 200: signal strength

#define ALP_CNC_AVAILABILITY_UNKNOWN   0
 

profile availability is unknown

#define ALP_CNC_AVAILABILITY_YES   1
 

profile is available

#define ALP_CNC_CANCEL_CHANNEL   ((uint8_t) 0x80)
 

Cancel the channel (no other connection attempt).

#define ALP_CNC_CANCELLED_SYSTEM   ((uint8_t) 2)
 

Channel connection was cancelled by the system.

#define ALP_CNC_CANCELLED_USER   ((uint8_t) 1)
 

Channel connection was cancelled by the user.

#define ALP_CNC_CHANNEL_LINK_BLUETOOTH   0x00000040
 

Bluetooth profile.

#define ALP_CNC_CHANNEL_LINK_CS   0x00000002
 

Data call circuit switch profile.

#define ALP_CNC_CHANNEL_LINK_ETHERNET   0x00000100
 

Ethernet profile.

#define ALP_CNC_CHANNEL_LINK_IPV6OVERIPV4   0x00000200
 

IPv6 over IPv4.

#define ALP_CNC_CHANNEL_LINK_PS   0x00000001
 

Data call packet switch profile.

#define ALP_CNC_CHANNEL_LINK_PS_IP   0x00000008
 

IP direct data call packet switch profile.

#define ALP_CNC_CHANNEL_LINK_USB   0x00000080
 

USB Ethernet profile.

#define ALP_CNC_CHANNEL_LINK_WIFI   0x00000020
 

WIFI profile.

#define ALP_CNC_CHANNEL_LINK_WIN_RAS   0x00000400
 

PPP over serial.

#define ALP_CNC_CHANNEL_SRV_BACKGROUND   0x20000000
 

Internal use.

#define ALP_CNC_CHANNEL_SRV_DM   0x00000200
 

DM profile.

#define ALP_CNC_CHANNEL_SRV_EMAIL   0x00000008
 

EMAIL able profile.

#define ALP_CNC_CHANNEL_SRV_GENERIC   0x10000000
 

generic Internet profile

#define ALP_CNC_CHANNEL_SRV_IM   0x00000020
 

IM able profile.

#define ALP_CNC_CHANNEL_SRV_MMS   0x00000002
 

MMS able profile.

#define ALP_CNC_CHANNEL_SRV_PTT   0x00000040
 

PTT able profile.

#define ALP_CNC_CHANNEL_SRV_SHAREABLE   0x00000100
 

Shareable profile.

#define ALP_CNC_CHANNEL_SRV_SIP   0x00000010
 

SIP able profile.

#define ALP_CNC_CHANNEL_SRV_SYNC   0x00000080
 

SYNC able profile.

#define ALP_CNC_CHANNEL_SRV_WAP   0x00000001
 

WAP able profile.

#define ALP_CNC_CHANNEL_SRV_WEB   0x00000004
 

WEB able profile.

#define ALP_CNC_CONNECT_ABORTED   512
 

(internal use) Aborted profile

#define ALP_CNC_CONNECT_ALLOWED   8192
 

(internal use) Set when an allowed application open a channel (no need to ask user)

#define ALP_CNC_CONNECT_ASK_USER   4096
 

(internal use) Sent when need to ask user in the connection process

#define ALP_CNC_CONNECT_BACKGROUND   65536
 

Background connection.

#define ALP_CNC_CONNECT_CHOOSER_UI   2
 

Ask user the profile to callback to.

#define ALP_CNC_CONNECT_DISABLE_FALLBACK   4
 

Disable fallback mechanism.

#define ALP_CNC_CONNECT_DISABLE_RECONNECTION   8
 

Disable auto-reconnnection mechanism.

#define ALP_CNC_CONNECT_END   128
 

(internal use) Connection ends

#define ALP_CNC_CONNECT_PASSWORD_REQUIRED   16384
 

(internal use) Set when a password prompt is required now for connecting the channel

#define ALP_CNC_CONNECT_PERSISTENT   256
 

Persistent (network) channels are marked persistent after connection.

#define ALP_CNC_CONNECT_PLUGIN_UI   32768
 

(internal use) Set when an UI input is required now for connecting the channel

#define ALP_CNC_CONNECT_PROGRESS_UI   1
 

Display progress UI.

#define ALP_CNC_CONNECT_SERVER_ASYNCHRONOUS   32
 

Connect asynchronously (server mode, from a plug-in).

#define ALP_CNC_CONNECT_SERVER_WRITE_FD   64
 

(internal use) Write fd to client (server only)

#define ALP_CNC_CONNECT_SHARED   1024
 

Shared profile (initiated by an external request).

#define ALP_CNC_CONNECT_SYNCHRONOUS   16
 

Connect synchronously.

#define ALP_CNC_CONNECT_TUNNEL   2048
 

Connect a tunneled connection.

#define ALP_CNC_CONNECTION_FAKE_FD   0x7FFFFFFF
 

Fake fd when connection does not return a real fd.

#define ALP_CNC_CONTROL_AVAILABILITY   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000006)
 

Control request to ask a profile availability.

#define ALP_CNC_CONTROL_BIND_DESTINATION   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000007)
 

Control to add a destination rule in the IP route table.

#define ALP_CNC_CONTROL_BUILTIN_CLASS   ((uint32_t) 0x00000000)
 

Class for builtin controls.

#define ALP_CNC_CONTROL_CABLE_DETECTION   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x0000000F)
 

Control used to associate an action on a profile with events on a cable.

#define ALP_CNC_CONTROL_DECONFIGURE   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000013)
 

Deconfigure TCP/IP settings.

#define ALP_CNC_CONTROL_DISCONNECT   (ALP_CNC_CONTROL_BUILTIN_CLASS | ALP_CNC_CONTROL_RECURSIVE|((uint32_t) 0x00000003))
 

Control sent to a profile to disconnect it.

#define ALP_CNC_CONTROL_GET_DATA   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000009)
 

Control used by VPN plug-ins to discuss with the VPN framework.

#define ALP_CNC_CONTROL_ITEM_CHANGED   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000002)
 

Control sent to a plug-in when a new profile is attached to it.

#define ALP_CNC_CONTROL_LOWERS_ONLY   ((uint32_t) 0x40000000)
 

Mask for control that only applies to lower plug-ins.

#define ALP_CNC_CONTROL_NET_ACCESS_CONNECTED   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x0000000E)
 

Control used when a profile containing NetAccess is connected.

#define ALP_CNC_CONTROL_NETIN_DOWN   (ALP_CNC_CONTROL_BUILTIN_CLASS | (ALP_CNC_CONTROL_RECURSIVE)|(uint32_t) 0x0000000B)
 

Control used by Netin framework when a new interface comes down.

#define ALP_CNC_CONTROL_NETIN_UP   (ALP_CNC_CONTROL_BUILTIN_CLASS | (ALP_CNC_CONTROL_RECURSIVE)|(uint32_t) 0x0000000A)
 

Control used by Netin framework when a new interface comes up.

#define ALP_CNC_CONTROL_NETOUT_ABORT   (ALP_CNC_CONTROL_BUILTIN_CLASS | ALP_CNC_CONTROL_LOWERS_ONLY | ALP_CNC_CONTROL_RECURSIVE | ((uint32_t) 0x0000000C))
 

Control used by connecting profiles to abort lower plug-ins.

#define ALP_CNC_CONTROL_NETOUT_DOWN   (ALP_CNC_CONTROL_BUILTIN_CLASS | ALP_CNC_CONTROL_RECURSIVE | ((uint32_t) 0x0000000D))
 

Control used when link becomes down because of an external event (i.e. pppd exits).

#define ALP_CNC_CONTROL_PRIORITY   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000001)
 

Control request to define profile priority (at creation time).

#define ALP_CNC_CONTROL_RECONFIGURE   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000012)
 

Reconfigure TCP/IP settings.

#define ALP_CNC_CONTROL_RECURSIVE   ((uint32_t) 0x80000000)
 

Mask for recursive control.

#define ALP_CNC_CONTROL_RESUME   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000011)
 

Resume a profile.

#define ALP_CNC_CONTROL_SUSPEND   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000010)
 

Suspend a profile.

#define ALP_CNC_CONTROL_TEST   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000004)
 

Control sent to a profile to test it.

#define ALP_CNC_CONTROL_UNBIND_DESTINATION   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000008)
 

Control to delete a destination rule in the IP route table.

#define ALP_CNC_CONTROL_USER_CHANGE   (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000005)
 

Control sent to a profile when the user made changes to it.

#define ALP_CNC_DISCONNECT_WITH_TIMEOUT   ((uint8_t) 0x40)
 

Use a pre-defined disconnection timeout.

#define ALP_CNC_DISCONNECTED_SYSTEM   ((uint8_t) 4)
 

Channel connection was disconnected by system.

#define ALP_CNC_DISCONNECTED_TIMEOUT   ((uint8_t) 5)
 

Channel connection was disconnected by system on timeout.

#define ALP_CNC_DISCONNECTED_USER   ((uint8_t) 3)
 

Channel connection was disconnected by user.

#define ALP_CNC_FLAG_MASK   ((uint8_t) 0x3F)
 

Disconnection Flags mask.

#define ALP_CNC_ICON_NAME_MAX_SIZE   64
 

#define ALP_CNC_NOT_CANCELLED   ((uint8_t) 0)
 

Channel was not cancelled/disconnected.

#define ALP_CNC_PROGRESS_CHOOSER   2
 

ask user for next profile to connect

#define ALP_CNC_PROGRESS_FINI   3
 

finalize progress

#define ALP_CNC_PROGRESS_INIT   0
 

initialize progress

#define ALP_CNC_PROGRESS_UPDATE   1
 

update progress

#define ALP_CNC_STATE_CONNECTED   ((uint8_t) 0x01)
 

Channel is connected.

#define ALP_CNC_STATE_CONNECTING   ((uint8_t) 0x02)
 

Channel is connecting.

#define ALP_CNC_STATE_DISCONNECTED   ((uint8_t) 0x04)
 

Channel is disconnected (was connected/connecting and became disconnnected).

#define ALP_CNC_STATE_DISCONNECTING   ((uint8_t) 0x08)
 

Channel is disconnecting.

#define ALP_CNC_STATE_FINAL   (ALP_CNC_STATE_CONNECTED | ALP_CNC_STATE_DISCONNECTED | ALP_CNC_STATE_SUSPENDED)
 

channel stable states

#define ALP_CNC_STATE_NOT_CONNECTED   ((uint8_t) 0x20)
 

Channel is not connected (has never been connected).

#define ALP_CNC_STATE_SUSPENDED   ((uint8_t) 0x10)
 

Channel is suspended.

#define ALP_CNC_STATE_UNKNOWN   ((uint8_t) 0x00)
 

reserved

#define ALP_NOTIFY_APP_ID_CNC_SERVER   "cncd"
 

Notification app id of connection manager server.

#define ALP_NOTIFY_EVENT_CNC_AVAILABILITY   "/alp/cnc/availability"
 

Notification eventually sent by a transport when it becomes available.

#define ALP_NOTIFY_EVENT_CNC_CONNECTION   "/alp/cnc/connection"
 

Notification sent by cncd when a profile is connected or disconnected.


Typedef Documentation

typedef struct _AlpCncChannel AlpCncChannel
 

Channel definition.

typedef struct _AlpCncChannelProfile AlpCncChannelProfile
 

Channel profile information.

typedef struct _AlpCncControl AlpCncControl
 

definition

typedef struct _AlpCncControlAvailability AlpCncControlAvailability
 

the availability control type

typedef struct _AlpCncControlBindDestination AlpCncControlBindDestination
 

the bind destination control type

typedef struct _AlpCncControlCableDetection AlpCncControlCableDetection
 

the cable detection control type

typedef struct _AlpCncControlNetin AlpCncControlNetin
 

the type used in NETIN_xxxx controls

typedef struct _AlpCncControlReconfigure AlpCncControlReconfigure
 

the reconfigure control

typedef void*() AlpCncProgressCallback(int request, void *data, void *u_data)
 

typedef struct _AlpNotifyEventCncAvailability AlpNotifyEventCncAvailability
 

the type used in the availability notification

typedef struct _AlpNotifyEventCncConnection AlpNotifyEventCncConnection
 

the type used in the connection notification


Function Documentation

alp_status_t alp_cnc_channel_add_service uint8_t  chan_id,
uint32_t  service
 

This function is called by alp_cnc_channel_create to set the service associated with the channel creation (email, web, etc). A specific application coulr override this suatomatic value. alp_cnc_channel_connect() uses the service value to associate automatic parameters at connection time. For example, if the profile "Auto:srvT=2,DisT=0" exists, the disconnection timeout of a profile will be set to 0 when connected from the MMS application.

Parameters:
[in] chan_id the ID of the channel to modify
[in] service One or more services defined with ALP_CNC_CHANNEL_SRV_XXX constants
Returns:
ALP_STATUS_OK in case of succes ALP_STATUS_CNC_OBJECT_NOT_FOUND if the chan_id does not exist ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_close uint8_t  chan_id,
uint8_t  reason
 

Close a channel: disconnect the channel (if connected) and then destroy it.

Parameters:
[in] chan_id The channel to disconnect and destroy
[in] reason The disconnection reason (see ALP_CNC_CANCELLED_XXX and ALP_CNC_DISCONNECTED_XXXX constants)
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_connect uint8_t  chan_id  ) 
 

Connect a channel;

Parameters:
[in] chan_id The channel to connect
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_create char *  tags,
uint32_t  flags,
uint8_t *  chan_id
 

Create a new channel. The channel is not connected. After this call, all profiles corresponding to the search criteria are stored in the channel fallback_list.

Parameters:
[in] tags The search criteria used to find a suitable profile (see ALP_CNC_CHANNEL_SRV_XXX and ALP_CNC_CHANNEL_LINK_XXX constants)
[in] flags Connection flags see ALP_CNC_CONNECT_XXX constants
[out] chan_id the ID of the created channel
Returns:
ALP_STATUS_OK in case of succes ALP_STATUS_CNC_MEMORY if memory cannot be allocated ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_create_id uint32_t  profile_id,
uint32_t  flags,
uint8_t *  chan_id
 

Create a new channel given a profile. The channel is not connected.

Parameters:
[in] profile_id The profile Id to connect
[in] flags Connection flags see ALP_CNC_CONNECT_XXX constants
[out] chan_id the ID of the created channel
Returns:
ALP_STATUS_OK in case of succes ALP_STATUS_CNC_MEMORY if memory cannot be allocated ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_destroy uint8_t  chan_id  ) 
 

Destroy a channel given its id

Parameters:
[in] chan_id The channel id
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_disconnect uint8_t  chan_id,
uint8_t  reason
 

Disconnect a channel

Parameters:
[in] chan_id The channel to disconnect
[in] reason The disconnection reason (see ALP_CNC_CANCELLED_XXX and ALP_CNC_DISCONNECTED_XXXX constants)
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

AlpCncChannel* alp_cnc_channel_get uint8_t  chan_id,
alp_status_t status
 

Get a copy of a channel given its id.

Parameters:
[in] chan_id the ID of the channel to get
[out] status ALP_STATUS_OK in case of succes ALP_STATUS_CNC_OBJECT_NOT_FOUND if the chanId does not exist ALP_STATUS_CNC_MEMORY if memory for the copy cannot be allocated ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed
Returns:
a copy of the channel
Remarks:
The returned structure should not be modified and must be release with free().

alp_status_t alp_cnc_channel_get_owner uint8_t  channel_id,
pid_t *  pidP
 

Get the application that asked for the connection of a channel (the owner)

Parameters:
[in] channel_id The channel
[out] pidP The returned pid of the channel owner
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed ALP_STATUS_CNC_OBJECT_NOT_FOUND if the channel does not exist

alp_status_t alp_cnc_channel_open char *  tags,
uint32_t  flags,
uint8_t *  chan_id
 

Open a channel: create a new channel and connect it.

Parameters:
[in] tags The search criteria used to find a suitable profile (see ALP_CNC_CHANNEL_SRV_XXX and ALP_CNC_CHANNEL_LINK_XXX constants)
[in] flags Connection flags see ALP_CNC_CONNECT_XXX constants
[out] chan_id the ID of the created channel
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_open_id uint32_t  profile_id,
uint32_t  flags,
uint8_t *  chan_id
 

Open a channel: create a new channel given a profile and connect it.

Parameters:
[in] profile_id The profile Id to connect
[in] flags Connection flags see ALP_CNC_CONNECT_XXX constants
[out] chan_id the ID of the created channel
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_select uint8_t  chan_id  ) 
 

Select the default channel in the running thread.

Parameters:
[in] chan_id The channel to select, or 0 to unable the CNC channel behavior
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_set_default char *  tags,
uint32_t  default_id
 

Store default profile to connect for a given search string

Parameters:
[in] tags The search string for the compatible profiles
[in] default_id Id of the profile to connect
Returns:
ALP_STATUS_OK in case of succes ALP_STATUS_CNC_OBJECT_NOT_FOUND if the default_id does not exist
Remarks:
A channel created with the same search sting must exist when calling this function

alp_status_t alp_cnc_channel_set_profiles uint8_t  chan_id,
uint8_t  count,
uint32_t *  listP
 

This function can be called between a alp_cnc_channel_create() and alp_cnc_channel_connect() to override the profile fallback list.

Parameters:
[in] chan_id the ID of the channel to modify
[in] count the number of profiles to set
[in] listP the profiles to set
Returns:
ALP_STATUS_OK in case of succes ALP_STATUS_CNC_OBJECT_NOT_FOUND if the chan_id does not exist ALP_STATUS_CNC_MEMORY if memory cannot be allocated ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_channel_set_proxies uint8_t  chan_id,
uint8_t  count,
uint32_t *  listP
 

This function can be called between a alp_cnc_channel_create() and alp_cnc_channel_connect() to override the proxy list.

Parameters:
[in] chan_id the ID of the channel to modify
[in] count the number of profiles to set
[in] listP the proxy list
Returns:
ALP_STATUS_OK in case of succes ALP_STATUS_CNC_OBJECT_NOT_FOUND if the chan_id does not exist ALP_STATUS_CNC_MEMORY if memory cannot be allocated ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

AlpCncChannel* alp_cnc_channel_wait alp_status_t status  ) 
 

Wait for a channel status and get a copy of it

Parameters:
[out] status ALP_STATUS_OK in case of succes ALP_STATUS_CNC_OBJECT_NOT_FOUND if the chanId does not exist ALP_STATUS_CNC_MEMORY if memory for the copy cannot be allocated ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed
Returns:
a copy of the channel
Remarks:
The returned structure should not be modified and must be release with free().

struct hostent* alp_cnc_gethostbyname const char *  name  ) 
 

A gethostbyname that also tries DNS servers of underlaying connection in case of tunneled connections (VPN for example)

Parameters:
[in] name name of the host to search
Returns:
The hsotent structure of the IP, NULL if error

alp_status_t alp_cnc_job_end uint32_t  jobId,
int  nbArgs,
char **  args
 

End a job initiated by the server and send arguments. This command is equivalent to a call to alp_cnc_job_end_init() followed by alp_cnc_job_end_fini()

Parameters:
[in] jobId The job id
[in] nbArgs Count of arguments
[in] args Array of string arguments
Returns:
ALP_STATUS_OK or ALP_STATUS_CNC_MEMORY or ALP_STATUS_CNC_COMMUNICATION

alp_status_t alp_cnc_job_end_fini int  fd,
int  nbArgs,
char **  args
 

End a job initiated by the server and send arguments

Parameters:
[in] fd The fd returned by alp_cnc_job_end_init()
[in] nbArgs Count of arguments
[in] args Array of string arguments
Returns:
ALP_STATUS_OK or ALP_STATUS_CNC_MEMORY or ALP_STATUS_CNC_COMMUNICATION

int alp_cnc_job_end_init uint32_t  jobId  ) 
 

Signal the server that the job begins. The server cancels the timeout and waits for alp_cnc_job_end_fini(). The server is also aware of abnormal job termination.

Parameters:
[in] jobId The job id
Returns:
a file descriptor to use in alp_cnc_job_end_fini()

alp_status_t alp_cnc_object_control uint32_t  objectId,
uint32_t  request,
AlpCncControl controlP
 

Call a specific request on an object

Parameters:
[in] objectId The object
[in] request The function number
[in,out] controlP parameters related to the control function
Remarks:
A new session is created to handle control function to avoid conflicting with other sessions (because of the make linear) => the object must be a submitted object

alp_status_t alp_cnc_profile_connect uint32_t  profileId,
uint32_t  flags,
int *  fd
 

Connect a given profile

Parameters:
[in] profileId The profile to connect
[in] flags Connection flags see ALP_CNC_CONNECT_XXX constants
[out] fd The fd associated with the connection
Returns:
An error

alp_status_t alp_cnc_profile_disconnect uint32_t  profileId,
uint8_t  reason
 

Disconnect a profile

Parameters:
[in] profileId The profile to disconnect
[in] reason The disconnection reason (see ALP_CNC_CANCELLED_XXX and ALP_CNC_DISCONNECTED_XXXX constants)
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

alp_status_t alp_cnc_profile_get_clients uint32_t  profileId,
uint8_t *  pidCountP,
pid_t **  pidListP
 

Get the list of applications using a profile

Parameters:
[in] profileId The profile
[out] pidCountP The size of the applications list
[out] pidListP The list of applications PIDs (must be freed by the caller)
Returns:
ALP_STATUS_CNC_OPEN_FAILED if the cnc server was not found ALP_STATUS_CNC_COMMUNICATION if communication with the cnc server failed

int alp_cnc_socket int  domain,
int  type,
int  protocol
 

This function creates a socket and binds it to the current selected channel

Parameters:
[in] domain The socket domain, only AF_INET and AF_INET6 are supported
[in] type The socket type (see socket call)
[in] protocol The socket protocol (see socket call)
Returns:
The created socket if the function succeeds, -1 on error.

int alp_cnc_unbound_socket int  domain,
int  type,
int  protocol
 

This function creates a standard socket and does not bind it to the current selected channel

Parameters:
[in] domain The socket domain, only AF_INET and AF_INET6 are supported
[in] type The socket type (see socket call)
[in] protocol The socket protocol (see socket call)
Returns:
The created socket if the function succeeds, -1 on error.


Variable Documentation

AlpCncProgressCallback* gcnc_progress
 

Progress callback global.


Generated on Wed Jul 30 07:06:42 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.