include/alp/cnc.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved.
00003  * Copyright (c) 2006-2007, ACCESS Systems Americas, Inc. All rights reserved.
00004  *****************************************************************************/
00012 #ifndef ALP_CNC_H_
00013 #define ALP_CNC_H_
00014 
00015 #include <libintl.h>
00016 #include <sys/types.h>
00017 #include <sys/socket.h>
00018 #include <net/if.h>
00019 
00020 #include <alp/config.h>
00021 #include <alp/types.h>
00022 #include <alp/sysclass.h>
00023 #include <alp/omadm_provisioning.h>
00024 
00025 #include <alp/syspaths.h>
00026 
00032 
00037 
00038 #define ALP_STATUS_CNC_INVALID_PARAM                            ((alp_status_t) (ALP_CLASS_CNC | 0x00010000))   
00039 #define ALP_STATUS_CNC_OPEN_FAILED                                      ((alp_status_t) (ALP_CLASS_CNC | 0x00020000))   
00040 #define ALP_STATUS_CNC_OBJECT_TABLE_FULL                        ((alp_status_t) (ALP_CLASS_CNC | 0x00030000))   
00041 #define ALP_STATUS_CNC_INVALID_PLUGIN_MODULE            ((alp_status_t) (ALP_CLASS_CNC | 0x00040000))   
00042 #define ALP_STATUS_CNC_MEMORY                                           ((alp_status_t) (ALP_CLASS_CNC | 0x00050000))   
00043 #define ALP_STATUS_CNC_NOT_IMPLEMENTED                          ((alp_status_t) (ALP_CLASS_CNC | 0x00060000))   
00044 #define ALP_STATUS_CNC_OBJECT_NOT_FOUND                         ((alp_status_t) (ALP_CLASS_CNC | 0x00070000))   
00045 #define ALP_STATUS_CNC_OBJECT_FULL                                      ((alp_status_t) (ALP_CLASS_CNC | 0x000A0000))   
00046 #define ALP_STATUS_CNC_INDEX_OUT_OF_RANGE                       ((alp_status_t) (ALP_CLASS_CNC | 0x000B0000))   
00047 #define ALP_STATUS_CNC_DATABASE                                         ((alp_status_t) (ALP_CLASS_CNC | 0x000C0000))   
00048 #define ALP_STATUS_CNC_COMMUNICATION                            ((alp_status_t) (ALP_CLASS_CNC | 0x000D0000))   
00049 #define ALP_STATUS_CNC_MODULE_ERROR                                     ((alp_status_t) (ALP_CLASS_CNC | 0x000E0000))   
00050 #define ALP_STATUS_CNC_INVALID_OBJECT                           ((alp_status_t) (ALP_CLASS_CNC | 0x000F0000))   
00051 #define ALP_STATUS_CNC_OBJECT_ALREADY_EXISTS            ((alp_status_t) (ALP_CLASS_CNC | 0x00100000))   
00052 #define ALP_STATUS_CNC_MANDATORY_PARAMETER_NOT_FOUND ((alp_status_t) (ALP_CLASS_CNC | 0x00110000))      
00053 #define ALP_STATUS_CNC_NO_PLUGIN_FORM                           ((alp_status_t) (ALP_CLASS_CNC | 0x00130000))   
00054 #define ALP_STATUS_CNC_OBJECT_IN_USE                            ((alp_status_t) (ALP_CLASS_CNC | 0x00160000))   
00055 #define ALP_STATUS_CNC_UNDELETABLE_OBJECT                       ((alp_status_t) (ALP_CLASS_CNC | 0x00180000))   
00056 #define ALP_STATUS_CNC_READ_ONLY_OBJECT                         ((alp_status_t) (ALP_CLASS_CNC | 0x00190000))   
00057 #define ALP_STATUS_CNC_PARAMETER_TYPE_MISMATCHED        ((alp_status_t) (ALP_CLASS_CNC | 0x001A0000))   
00058 #define ALP_STATUS_CNC_PARAMETER_SIZE_OVERFLOW          ((alp_status_t) (ALP_CLASS_CNC | 0x001B0000))   
00059 #define ALP_STATUS_CNC_PARAMETER_BAD_VALUE                      ((alp_status_t) (ALP_CLASS_CNC | 0x001C0000))   
00060 #define ALP_STATUS_CNC_IOCTL_FAILED                                     ((alp_status_t) (ALP_CLASS_CNC | 0x001D0000))   
00061 #define ALP_STATUS_CNC_SHELLCMD_FAILED                          ((alp_status_t) (ALP_CLASS_CNC | 0x001E0000))   
00062 #define ALP_STATUS_CNC_RESOURCE_ERROR                           ((alp_status_t) (ALP_CLASS_CNC | 0x001F0000))   
00063 #define ALP_STATUS_CNC_PROFILE_UNUSABLE                         ((alp_status_t) (ALP_CLASS_CNC | 0x00200000))   
00064 #define ALP_STATUS_CNC_PROFILE_UNAVAILABLE                      ((alp_status_t) (ALP_CLASS_CNC | 0x00210000))   
00065 #define ALP_STATUS_CNC_NON_AUTHORIZED                   ((alp_status_t) (ALP_CLASS_CNC | 0x00220000))   
00066 #define ALP_STATUS_CNC_CANCELLED                                ((alp_status_t) (ALP_CLASS_CNC | 0x00230000))   
00067 #define ALP_STATUS_CNC_NO_UI_MODE                               ((alp_status_t) (ALP_CLASS_CNC | 0x00240000))   
00068 #define ALP_STATUS_CNC_CONNECT_FAILED                   ((alp_status_t) (ALP_CLASS_CNC | 0x00800000))   
00069 
00070 // Generic sub-error codes for the ALP_STATUS_CNC_CONNECTION_ERROR error
00071 #define ALP_STATUS_CNC_CONNECT_GENERIC_ERROR            0x0000  
00072 #define ALP_STATUS_CNC_CONNECT_FATAL_ERROR                      0x0100  
00073 #define ALP_STATUS_CNC_CONNECT_INVALID_PROFILE          0x0200  
00074 #define ALP_STATUS_CNC_CONNECT_MEMORY                           0x0300  
00075 #define ALP_STATUS_CNC_CONNECT_AUTHENTICATION           0x0400  
00076 #define ALP_STATUS_CNC_CONNECT_NOT_SUPPORTED            0x0500  
00077 #define ALP_STATUS_CNC_CONNECT_UNPLUGGED                        0x0600  
00078 #define ALP_STATUS_CNC_CONNECT_BUSY                                     0x0700  
00079 #define ALP_STATUS_CNC_CONNECT_NO_MORE_CHANNEL          0x0800  
00080 #define ALP_STATUS_CNC_CONNECT_UNAVAILABLE                      0x0900  
00081 #define ALP_STATUS_CNC_CONNECT_SETUP_FAILED                     0x0A00  
00082 #define ALP_STATUS_CNC_CONNECT_SERVER_FAILED            0x0B00  
00083 #define ALP_STATUS_CNC_CONNECT_TIMEOUT                          0x0C00  
00084 #define ALP_STATUS_CNC_CONNECT_MISSING_PARAMETER        0x0D00  
00085 #define ALP_STATUS_CNC_CONNECT_NO_CONNECTION            0x0E00  
00086 #define ALP_STATUS_CNC_CONNECT_NO_UI_MODE               0x0F00  
00087 #define ALP_STATUS_CNC_CONNECT_CANCELLED                0x1000  
00088 
00089 #define ALP_CNC_CONNECT_STATUS(plugin,suberr)                           (ALP_STATUS_CNC_CONNECT_FAILED| plugin | suberr)
00090 #define ALP_CNC_CONNECT_GENERIC_STATUS(suberr)                          ALP_CNC_CONNECT_STATUS(0, suberr)
00091 #define ALP_CNC_CONNECT_CUSTOM_STATUS(status,plugin,suberr)     (((status) & 0xFFFF0000) | plugin | suberr)
00092 
00094 
00095 #define ALP_CNC_INVALID_RECORD_ID                                       0                                                                                               
00096 
00097 typedef struct _AlpCncSession AlpCncSession;
00098 
00100 
00101 
00108 
00109 typedef struct _AlpCncChannelProfile AlpCncChannelProfile;
00110 typedef struct _AlpCncChannel AlpCncChannel;
00111 typedef struct _AlpCncControl AlpCncControl;
00112 typedef struct _AlpCncControlAvailability AlpCncControlAvailability;
00113 typedef struct _AlpCncControlCableDetection AlpCncControlCableDetection;
00114 typedef struct _AlpCncControlBindDestination AlpCncControlBindDestination;
00115 typedef struct _AlpCncControlNetin AlpCncControlNetin;
00116 typedef struct _AlpCncControlReconfigure AlpCncControlReconfigure;
00117 typedef struct _AlpNotifyEventCncConnection AlpNotifyEventCncConnection;
00118 typedef struct _AlpNotifyEventCncAvailability AlpNotifyEventCncAvailability;
00119 
00121 
00122 
00127 
00132 #define  ALP_CNC_CHANNEL_SRV_WAP                        0x00000001              
00133 #define  ALP_CNC_CHANNEL_SRV_MMS                        0x00000002              
00134 #define  ALP_CNC_CHANNEL_SRV_WEB                        0x00000004              
00135 #define  ALP_CNC_CHANNEL_SRV_EMAIL                      0x00000008              
00136 #define  ALP_CNC_CHANNEL_SRV_SIP                        0x00000010              
00137 #define  ALP_CNC_CHANNEL_SRV_IM                         0x00000020              
00138 #define  ALP_CNC_CHANNEL_SRV_PTT                        0x00000040              
00139 #define  ALP_CNC_CHANNEL_SRV_SYNC                       0x00000080              
00140 #define  ALP_CNC_CHANNEL_SRV_SHAREABLE          0x00000100              
00141 #define  ALP_CNC_CHANNEL_SRV_DM                         0x00000200              
00142 #define  ALP_CNC_CHANNEL_SRV_GENERIC            0x10000000              
00143 #define  ALP_CNC_CHANNEL_SRV_BACKGROUND         0x20000000              
00144 
00145 
00146 
00152 #define  ALP_CNC_CHANNEL_LINK_CS                        0x00000002              
00153 #define  ALP_CNC_CHANNEL_LINK_PS                        0x00000001              
00154 #define  ALP_CNC_CHANNEL_LINK_PS_IP                     0x00000008              
00155 #define  ALP_CNC_CHANNEL_LINK_WIFI                      0x00000020              
00156 #define  ALP_CNC_CHANNEL_LINK_BLUETOOTH         0x00000040              
00157 #define  ALP_CNC_CHANNEL_LINK_USB                       0x00000080              
00158 #define  ALP_CNC_CHANNEL_LINK_ETHERNET          0x00000100              
00159 #define  ALP_CNC_CHANNEL_LINK_IPV6OVERIPV4      0x00000200              
00160 #define  ALP_CNC_CHANNEL_LINK_WIN_RAS           0x00000400              
00161 
00162 
00163 
00164 
00165 #define ALP_CNC_CONNECT_PROGRESS_UI                             1                       
00166 #define ALP_CNC_CONNECT_CHOOSER_UI                              2                       
00167 #define ALP_CNC_CONNECT_DISABLE_FALLBACK                4                       
00168 #define ALP_CNC_CONNECT_DISABLE_RECONNECTION    8                       
00169 #define ALP_CNC_CONNECT_SYNCHRONOUS                             16                      
00170 #define ALP_CNC_CONNECT_SERVER_ASYNCHRONOUS             32                      
00171 #define ALP_CNC_CONNECT_SERVER_WRITE_FD                 64                      
00172 #define ALP_CNC_CONNECT_END                                             128                     
00173 #define ALP_CNC_CONNECT_PERSISTENT                              256                     
00174 #define ALP_CNC_CONNECT_ABORTED                                 512                     
00175 #define ALP_CNC_CONNECT_SHARED                                  1024            
00176 #define ALP_CNC_CONNECT_TUNNEL                                  2048            
00177 #define ALP_CNC_CONNECT_ASK_USER                                4096            
00178 #define ALP_CNC_CONNECT_ALLOWED                                 8192            
00179 #define ALP_CNC_CONNECT_PASSWORD_REQUIRED               16384           
00180 #define ALP_CNC_CONNECT_PLUGIN_UI                               32768           
00181 #define ALP_CNC_CONNECT_BACKGROUND                              65536           
00182 
00183 
00184 
00185 
00186 #define ALP_CNC_CONNECTION_FAKE_FD                              0x7FFFFFFF      
00187 
00188 
00189 
00190 
00191 #define ALP_CNC_STATE_UNKNOWN                                   ((uint8_t) 0x00)                
00192 #define ALP_CNC_STATE_CONNECTED                                 ((uint8_t) 0x01)                
00193 #define ALP_CNC_STATE_CONNECTING                                ((uint8_t) 0x02)                
00194 #define ALP_CNC_STATE_DISCONNECTED                              ((uint8_t) 0x04)                
00195 #define ALP_CNC_STATE_DISCONNECTING                             ((uint8_t) 0x08)                
00196 #define ALP_CNC_STATE_SUSPENDED                                 ((uint8_t) 0x10)                
00197 #define ALP_CNC_STATE_NOT_CONNECTED                             ((uint8_t) 0x20)                
00198 #define ALP_CNC_STATE_FINAL                                             (ALP_CNC_STATE_CONNECTED | ALP_CNC_STATE_DISCONNECTED | ALP_CNC_STATE_SUSPENDED)        
00199 
00200 
00201 
00202 
00203 #define ALP_CNC_NOT_CANCELLED                                   ((uint8_t) 0)                   
00204 #define ALP_CNC_CANCELLED_USER                                  ((uint8_t) 1)                   
00205 #define ALP_CNC_CANCELLED_SYSTEM                                ((uint8_t) 2)                   
00206 #define ALP_CNC_DISCONNECTED_USER                               ((uint8_t) 3)                   
00207 #define ALP_CNC_DISCONNECTED_SYSTEM                             ((uint8_t) 4)                   
00208 #define ALP_CNC_DISCONNECTED_TIMEOUT                    ((uint8_t) 5)                   
00209 
00210 #define ALP_CNC_CANCEL_CHANNEL                                  ((uint8_t) 0x80)                
00211 #define ALP_CNC_DISCONNECT_WITH_TIMEOUT                 ((uint8_t) 0x40)                
00212 #define ALP_CNC_FLAG_MASK                                               ((uint8_t) 0x3F)                
00213 
00214 
00216 
00218 
00219 #define ALP_CNC_AVAILABILITY_UNKNOWN                    0                       
00220 #define ALP_CNC_AVAILABILITY_YES                                1                       
00221 #define ALP_CNC_AVAILABILITY_PERCENT_BASE               100                     
00222 #define ALP_CNC_AVAILABILITY_NO                                 255                     
00223 
00224 
00225 
00226 // must be in the 0x00000000 to 0x000000FF range
00228 #define ALP_CNC_CONTROL_RECURSIVE                       ((uint32_t) 0x80000000)         
00229 #define ALP_CNC_CONTROL_LOWERS_ONLY                     ((uint32_t) 0x40000000)         
00230 
00231 #define ALP_CNC_CONTROL_BUILTIN_CLASS           ((uint32_t) 0x00000000)         
00232 
00233 #define ALP_CNC_CONTROL_PRIORITY                        (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000001)         
00234 #define ALP_CNC_CONTROL_ITEM_CHANGED            (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000002)         
00235 #define ALP_CNC_CONTROL_DISCONNECT                      (ALP_CNC_CONTROL_BUILTIN_CLASS | ALP_CNC_CONTROL_RECURSIVE|((uint32_t) 0x00000003))             
00236 #define ALP_CNC_CONTROL_TEST                            (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000004)         
00237 #define ALP_CNC_CONTROL_USER_CHANGE                     (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000005)         
00238 #define ALP_CNC_CONTROL_AVAILABILITY            (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000006)         
00239 #define ALP_CNC_CONTROL_BIND_DESTINATION        (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000007)         
00240 #define ALP_CNC_CONTROL_UNBIND_DESTINATION      (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000008)         
00241 #define ALP_CNC_CONTROL_GET_DATA                        (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000009)         
00242 #define ALP_CNC_CONTROL_NETIN_UP                        (ALP_CNC_CONTROL_BUILTIN_CLASS | (ALP_CNC_CONTROL_RECURSIVE)|(uint32_t) 0x0000000A)             
00243 #define ALP_CNC_CONTROL_NETIN_DOWN                      (ALP_CNC_CONTROL_BUILTIN_CLASS | (ALP_CNC_CONTROL_RECURSIVE)|(uint32_t) 0x0000000B)             
00244 #define ALP_CNC_CONTROL_NETOUT_ABORT            (ALP_CNC_CONTROL_BUILTIN_CLASS | ALP_CNC_CONTROL_LOWERS_ONLY  | ALP_CNC_CONTROL_RECURSIVE |     ((uint32_t) 0x0000000C))                
00245 #define ALP_CNC_CONTROL_NETOUT_DOWN                     (ALP_CNC_CONTROL_BUILTIN_CLASS | ALP_CNC_CONTROL_RECURSIVE | ((uint32_t) 0x0000000D))   
00246 #define ALP_CNC_CONTROL_NET_ACCESS_CONNECTED (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x0000000E)    
00247 #define ALP_CNC_CONTROL_CABLE_DETECTION         (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x0000000F)         
00248 #define ALP_CNC_CONTROL_SUSPEND                         (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000010)         
00249 #define ALP_CNC_CONTROL_RESUME                          (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000011)         
00250 #define ALP_CNC_CONTROL_RECONFIGURE                     (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000012)         
00251 #define ALP_CNC_CONTROL_DECONFIGURE                     (ALP_CNC_CONTROL_BUILTIN_CLASS | (uint32_t) 0x00000013)         
00252 
00253 
00254 
00256 
00257 #define ALP_CNC_PROGRESS_INIT                           0                               
00258 #define ALP_CNC_PROGRESS_UPDATE                         1                               
00259 #define ALP_CNC_PROGRESS_CHOOSER                        2                               
00260 #define ALP_CNC_PROGRESS_FINI                           3                               
00261 
00262 
00263 
00264 
00265 #define ALP_NOTIFY_APP_ID_CNC_SERVER            "cncd"                                  
00266 #define ALP_NOTIFY_EVENT_CNC_CONNECTION         "/alp/cnc/connection"   
00267 #define ALP_NOTIFY_EVENT_CNC_AVAILABILITY       "/alp/cnc/availability" 
00268 
00269 
00270 #define ALP_CNC_ICON_NAME_MAX_SIZE      64
00271 
00272 // Data channel related definitions
00273 
00274 typedef void* (AlpCncProgressCallback) (int request, void* data, void* u_data);
00275 
00277 extern AlpCncProgressCallback* gcnc_progress;
00278 
00280 
00282 
00283 struct _AlpCncChannelProfile {
00284         uint32_t id;                                       
00285         uint32_t proxy_id;                                 
00286         alp_status_t error;                                
00287         uint8_t availability;                      
00288 };
00289 
00290 struct _AlpCncChannel {
00291         AlpCncChannelProfile *profiles;    
00292         uint32_t default_profile_id;       
00293         uint32_t flags;                                    
00294         uint16_t timeout;                                  
00295         uint16_t global_state;                     
00296         alp_status_t error;                                
00297         int fd;                                                    
00298         uint16_t progress_string_id;       
00299         uint16_t progress_bitmap_id;       
00300         uint32_t progress_data;                    
00301         uint32_t plugin_id;                                
00302         uint32_t profile_id;                       
00303         int8_t plugin_index;                       
00304         int8_t plugins_count;                      
00305         uint8_t channel_id;                                
00306         int8_t profiles_count;                     
00307         int8_t profile_index;                      
00308         uint8_t state;                                     
00309         uint8_t cancelled;                                 
00310         int8_t proxies_count;                      
00311         uint32_t service;                                  
00312 };
00313 
00314 struct _AlpCncControl {
00315         uint16_t size;                                     
00316         AlpCncSession* session;                    
00317         alp_status_t error;                                
00318         uint32_t id;                                       
00319         int16_t index;                                     
00320         int16_t count;                                     
00321         uint32_t data;                                     
00322 };
00323 
00324 struct _AlpCncControlAvailability {
00325         AlpCncControl control;                                          
00326         char iconName[ALP_CNC_ICON_NAME_MAX_SIZE];      
00327         uint8_t availability;                                           
00328 };
00329 
00330 struct _AlpCncControlBindDestination {
00331         AlpCncControl control;                          
00332         uint32_t addr;                                  
00333         uint32_t profile_id;                            
00334         uint32_t tunnel_id;                             
00335 };
00336 
00337 struct _AlpCncControlCableDetection {
00338         AlpCncControl control;                          
00339         uint32_t profile_id;                            
00340         char interface_name[IF_NAMESIZE];               
00341 };
00342 
00343 struct _AlpCncControlNetin {
00344         AlpCncControl control;                          
00345         char device[8];                                         
00346         char ipv4[16];                                          
00347         uint8_t chan_id;                                        
00348 };
00349 
00350 struct _AlpCncControlReconfigure {
00351         AlpCncControl control;                          
00352         char interface_name[IF_NAMESIZE];       
00353         char local_ip[20];
00354         char dns[256];
00355         char gateway[16];
00356         char domains[256];
00357 };
00358 
00359 struct _AlpNotifyEventCncConnection {
00360         uint32_t profile_id;                       
00361         alp_status_t error;                                
00362         uint8_t state;                                     
00363         uint8_t cancelled;                                 
00364 };
00365 
00366 struct _AlpNotifyEventCncAvailability {
00367         uint32_t links;                                    
00368         uint32_t profile_id;                       
00369 };
00370 
00377 
00379 
00380 #define ALP_CNC_OBJECT_ALL                                      ((uint8_t) 0xFF)                        
00381 #define ALP_CNC_OBJECT_PLUGIN                           ((uint8_t) 0x01)                        
00382 #define ALP_CNC_OBJECT_INTERFACE                        ((uint8_t) 0x02)                        
00383 #define ALP_CNC_OBJECT_PROFILE                          ((uint8_t) 0x04)                        
00384 #define ALP_CNC_OBJECT_TEMPLATE                         ((uint8_t) 0x08)                        
00385 #define ALP_CNC_OBJECT_LINK                                     ((uint8_t) 0x10)                        
00386 
00387 
00388 
00389 
00390 // ALP_CNC_PARAMETER_TYPE_UNDEFINED must be 0x00
00391 #define ALP_CNC_PARAMETER_TYPE_UNDEFINED        ((uint8_t) 0)                           
00392 #define ALP_CNC_PARAMETER_TYPE_INTEGER          ((uint8_t) 1)                           
00393 #define ALP_CNC_PARAMETER_TYPE_STRING           ((uint8_t) 2)                           
00394 #define ALP_CNC_PARAMETER_TYPE_BINARY           ((uint8_t) 3)                           
00395 
00396 
00397 
00398 
00399 #define ALP_CNC_PARAMETER_FIRST_RESERVED        ((uint32_t) 0x00000000)         
00400 #define ALP_CNC_PARAMETER_LAST_RESERVED         ((uint32_t) 0x0000001F)         
00401 // the following constant must be 0
00402 #define ALP_CNC_PARAMETER_TABLE_END                     ALP_CNC_PARAMETER_FIRST_RESERVED                        
00403 #define ALP_CNC_PARAMETER_UNDEFINED                     (ALP_CNC_PARAMETER_FIRST_RESERVED + 1)          
00404 
00405 
00406 
00411 #define ALP_CNC_INSERT_AT_END_INDEX                     ((int16_t)      0x7FFF)                 
00412 
00413 
00414 
00419 #define ALP_CNC_GET_PARAMETERS_WHOLE_PROFILE    ((int8_t) 63)           
00420 #define ALP_CNC_GET_PARAMETERS_ITEM_ONLY                ((int8_t) 0)            
00421 #define ALP_CNC_GET_PARAMETERS_INHERITED                ((int8_t) -64)          
00422 #define ALP_CNC_GET_PARAMETERS_CHILDREN                 ((int8_t) 62)           
00423 #define ALP_CNC_GET_PARAMETERS_ACTIVE                   ((int8_t) 128)          
00424 
00425 
00426 
00427 
00428 #define ALP_CNC_PARAMETER_CHECK_NOTHING         0               
00429 #define ALP_CNC_PARAMETER_CHECK_TYPE_AND_SIZE   0x01    
00430 #define ALP_CNC_PARAMETER_CHECK_MANDATORY               0x02    
00431 //For no size checking  
00432 #define ALP_CNC_PARAMETER_NO_SIZE                               0               
00433 
00434 
00435 // max length of an object name (bumped ALP_CNC_MAX_NAME_LENGTH from 31 to 63
00436 // for UTF-8).
00437 #define ALP_CNC_MAX_NAME_LENGTH                                 63              
00438 
00439 
00443 #define ALP_CNC_NAME_FLAG_INFO                          ((uint32_t) 1)                  
00444 #define ALP_CNC_INFO_FLAG_PRIORITY                      ((uint32_t) 2)                  
00445 #define ALP_CNC_INFO_FLAG_AVAILABILITY          ((uint32_t) 4)                  
00446 #define ALP_CNC_INFO_FLAG_OPTIONS                       ((uint32_t) 8)                  
00447 #define ALP_CNC_INFO_FLAG_OPTIONS_SET           ((uint32_t) 16)                 
00448 #define ALP_CNC_INFO_FLAG_OPTIONS_CLEAR         ((uint32_t) 32)                 
00449 #define ALP_CNC_INFO_FLAG_OPTIONS_INVERT        ((uint32_t) 64)                 
00450 #define ALP_CNC_INFO_FLAG_TOGGLE_TEMPLATE       ((uint32_t) 128)                
00451 #define ALP_CNC_INFO_FLAG_MANUAL_ID                     ((uint32_t) 256)                
00452 #define ALP_CNC_INFO_FLAG_TOGGLE_LINK           ((uint32_t) 512)                
00453 #define ALP_CNC_INFO_FLAG_FNAME                         ((uint32_t) 1024)               
00454 #define ALP_CNC_INFO_FLAG_MASK                          ((uint32_t) 2047)               
00455 
00456 
00457 
00458 
00459 #define ALP_CNC_OPTION_IS_CONNECTED                     ((uint32_t) 0x1000)             
00460 #define ALP_CNC_OPTION_IS_SUSPENDED                     ((uint32_t) 0x2000)             
00461 #define ALP_CNC_OPTION_USABLE                           ((uint32_t) 0x0001)             
00462 #define ALP_CNC_OPTION_VISIBLE                          ((uint32_t) 0x0002)             
00463 #define ALP_CNC_OPTION_UNSEARCHABLE                     ((uint32_t) 0x0004)             
00464 #define ALP_CNC_OPTION_READ_ONLY                        ((uint32_t) 0x0008)             
00465 #define ALP_CNC_OPTION_REPLACE_ON_USING         ((uint32_t) 0x0010)             
00466 #define ALP_CNC_OPTION_UNDELETABLE                      ((uint32_t) 0x0020)             
00467 #define ALP_CNC_OPTION_PERSISTENT                       ((uint32_t) 0x0040)             
00468 #define ALP_CNC_OPTION_MANUAL_MODE                      ((uint32_t) 0x0080)             
00469 #define ALP_CNC_OPTION_USER_CAN_CHANGE_MODE     ((uint32_t) 0x0100)             
00470 #define ALP_CNC_OPTION_TESTABLE                         ((uint32_t) 0x0200)             
00471 
00472 
00473 
00474 
00475 #define ALP_CNC_PRIORITY_EDGE                           ((uint8_t)  0)                  
00476 #define ALP_CNC_PRIORITY_UNKNOWN_PROFILE        ((uint8_t)  1)                  
00477 
00478 
00479 
00480 
00481 #define ALP_CNC_MOVE_UP                                         -1                                              
00482 #define ALP_CNC_MOVE_DOWN                                       +1                                              
00483 #define ALP_CNC_MOVE_AS_DEFAULT                         -128                                    
00484 #define ALP_CNC_MOVE_LAST                                       127                                             
00485 
00486 
00487 
00488 
00489 #define ALP_CNC_FIND_GET_TYPE(X)                        ((uint8_t) ((X) & 0x000000FF))                          
00490 
00491 #define ALP_CNC_FIND_ALL                                        ((uint32_t) ALP_CNC_OBJECT_ALL)                         
00492 #define ALP_CNC_FIND_PLUGINS                            ((uint32_t) ALP_CNC_OBJECT_PLUGIN)                      
00493 #define ALP_CNC_FIND_INTERFACES                         ((uint32_t) ALP_CNC_OBJECT_INTERFACE)           
00494 #define ALP_CNC_FIND_PROFILES                           ((uint32_t) ALP_CNC_OBJECT_PROFILE)                     
00495 #define ALP_CNC_FIND_TEMPLATES                          ((uint32_t) ALP_CNC_OBJECT_TEMPLATE)            
00496 #define ALP_CNC_FIND_LINKS                                      ((uint32_t) ALP_CNC_OBJECT_LINK)                        
00497 #define ALP_CNC_FIND_AVAILABLE                          ((uint32_t) 0x100)                                                      
00498 #define ALP_CNC_FIND_USABLE                                     ((uint32_t) 0x200)                                                      
00499 #define ALP_CNC_FIND_INVISIBLE                          ((uint32_t) 0x400)                                                      
00500 #define ALP_CNC_FIND_CHECK_AVAILABILITY         ((uint32_t) 0x800)                                                      
00501 #define ALP_CNC_FIND_CONNECTED                          ((uint32_t) 0x1000)                                                     
00502 #define ALP_CNC_FIND_PROVISIONED                        ((uint32_t) 0x2000)                                                     
00503 
00504 
00505 #define ALP_CNC_FIND_ALL_COUNT_MAX                      128                                                                                     
00506 
00507 #define ALP_CNC_FIND_DEFAULT                            (ALP_CNC_FIND_PROFILES)                                         
00508 
00509 
00510 
00512 
00513 #define ALP_CNC_ROOT_PLUGINS                            "PluginsRoot"                                                           
00514 #define ALP_CNC_ROOT_TECHNOLOGIES                       "TechnologiesRoot"                                                      
00515 #define ALP_CNC_PROXY                                           "Proxy"                                                                         
00516 #define ALP_CNC_DEFAULT                                         "Default"                                                                       
00517 #define ALP_CNC_AUTO                                            "Auto"                                                                          
00518 #define ALP_CNC_AUTO_PROFILE                            "auto-all"                                                                      
00519 
00520 #define ALP_CNC_MACRO_SPECIAL_CHAR                      '{'                                                                                     
00521 #define ALP_CNC_MACRO_USING                                     "{USING}"                                                                       
00522 #define ALP_CNC_MACRO_REPLACE                           "{REPLACE}"                                                                     
00523 
00524 
00525 #define CNC_BUILTIN_DOMAINNAME                          "cnc_builtin"                                                           
00526 
00527 typedef struct _AlpCncParameter AlpCncParameter;
00528 typedef struct _AlpCncObjectInfo AlpCncObjectInfo;
00529 
00531 
00532 struct _AlpCncParameter {
00533         uint32_t name;                                     //< parameter name
00534         uint16_t size;                                     //< size of the value in bytes
00535         uint8_t type;                                      //< parameter type (see kCncXxxxParameterType)
00536         uint8_t flags;                                     //<  flags for parameter checking
00537         union {
00538                 uint32_t asInteger;
00539                 char *asString;
00540                 uint8_t *asBinary;
00541         } value;                                                   //< parameter value
00542 };
00543 
00544 struct _AlpCncObjectInfo {
00545         char name[ALP_CNC_MAX_NAME_LENGTH + 1];                         
00546         uint32_t object_id;                                                                     
00547         uint8_t version;                                                                        
00548         uint8_t type;                                                                           
00549         uint16_t count;                                                                         
00550         uint8_t priority;                                                                       
00551         uint8_t availability;                                                           
00552         uint16_t options;                                                                       
00553         uint32_t manual_id;                                                                     
00554         uint32_t fname_plugin_id;                                                       
00555         uint16_t fname_id;                                                                      
00556         char avail_icon_name[ALP_CNC_ICON_NAME_MAX_SIZE];       
00557 };
00558 
00563 
00568 
00569 // configuration application mode constants
00570 #define ALP_CNC_MODE_TECHNOLOGY                         ((uint32_t) 1)                          
00571 #define ALP_CNC_MODE_PROFILE                            ((uint32_t) 2)                          
00572 #define ALP_CNC_MODE_NEW                                        ((uint32_t) 4)                          
00573 #define ALP_CNC_MODE_DELETE                                     ((uint32_t) 8)                          
00574 #define ALP_CNC_MODE_EDIT                                       ((uint32_t) 16)                         
00575 #define ALP_CNC_MODE_FULL                                       (ALP_CNC_MODE_TECHNOLOGY | ALP_CNC_MODE_PROFILE | ALP_CNC_MODE_NEW | ALP_CNC_MODE_DELETE | ALP_CNC_MODE_EDIT)           
00576 #define ALP_CNC_MODE_PANEL                                      (ALP_CNC_MODE_PROFILE | ALP_CNC_MODE_NEW | ALP_CNC_MODE_DELETE | ALP_CNC_MODE_EDIT)     
00577 #define ALP_CNC_MODE_APP_SWITCH                         ((uint32_t) 0x8000)                     
00578 #define ALP_CNC_MODE_NO_DONE_BUTTON                     ((uint32_t) 0x4000)                     
00579 
00580 #define ALP_CNC_UI_CTL_OP_CANCEL                1 
00581 #define ALP_CNC_UI_CTL_OP_SAVE                  2 
00582 #define ALP_CNC_UI_CTL_OP_CHECK                 3 
00583 
00584 
00585 typedef union _AlpCncEditParameters {
00586         uint32_t                appSelector;
00587         void*                   appData;
00588 } AlpCncEditParameters;
00589 
00591 
00593 
00594 #ifdef __cplusplus
00595 extern "C"{
00596 #endif 
00597 
00602 
00604 
00606 
00618         alp_status_t alp_cnc_channel_open_id(uint32_t profile_id, uint32_t flags, uint8_t * chan_id);
00619 
00631         alp_status_t alp_cnc_channel_open(char *tags, uint32_t flags, uint8_t * chan_id);
00642         alp_status_t alp_cnc_channel_close(uint8_t chan_id, uint8_t reason);
00657         alp_status_t alp_cnc_channel_create_id(uint32_t profile_id, uint32_t flags, uint8_t * chan_id);
00674         alp_status_t alp_cnc_channel_create(char *tags, uint32_t flags, uint8_t * chan_id);
00684         alp_status_t alp_cnc_channel_destroy(uint8_t chan_id);
00693         alp_status_t alp_cnc_channel_connect(uint8_t chan_id);
00704         alp_status_t alp_cnc_channel_disconnect(uint8_t chan_id, uint8_t reason);
00720         AlpCncChannel * alp_cnc_channel_wait(alp_status_t * status);
00721 
00731         alp_status_t alp_cnc_channel_select(uint8_t chan_id);
00747         alp_status_t alp_cnc_channel_set_profiles(uint8_t chan_id, uint8_t count, uint32_t * listP);
00748 
00764         alp_status_t alp_cnc_channel_set_proxies(uint8_t chan_id, uint8_t count, uint32_t * listP);
00765 
00784         alp_status_t alp_cnc_channel_add_service(uint8_t chan_id, uint32_t service);
00785 
00802         AlpCncChannel *alp_cnc_channel_get(uint8_t chan_id, alp_status_t * status);
00803 
00804 
00817         alp_status_t alp_cnc_channel_set_default(char* tags, uint32_t default_id);
00818 
00820 
00822 
00824 
00833         alp_status_t alp_cnc_profile_connect(uint32_t profileId, uint32_t flags, int* fd);
00834 
00845         alp_status_t alp_cnc_profile_disconnect(uint32_t profileId, uint8_t reason);
00846 
00858         alp_status_t alp_cnc_profile_get_clients(uint32_t profileId, uint8_t *pidCountP, pid_t ** pidListP);
00859 
00871         alp_status_t alp_cnc_channel_get_owner(uint8_t channel_id, pid_t * pidP);
00872 
00887         alp_status_t alp_cnc_object_control(uint32_t objectId, uint32_t request, AlpCncControl* controlP);
00889 
00891 
00893 
00902         struct hostent *alp_cnc_gethostbyname(const char *name);
00903 
00913         int alp_cnc_socket(int domain, int type, int protocol);
00914 
00925         int alp_cnc_unbound_socket(int domain, int type, int protocol);
00926 
00928 
00930 
00931 
00936 
00938 
00940 
00955         alp_status_t alp_cnc_object_lock(uint32_t Id);
00956 
00967         alp_status_t alp_cnc_object_unlock(uint32_t lockedId);
00968 
00980         alp_status_t alp_cnc_object_submit(uint32_t lockedId);
00991         alp_status_t alp_cnc_object_delete(uint32_t nodeId);
00992 
01008         alp_status_t alp_cnc_object_regroup_submit(uint32_t lockedId);
01009 
01024         alp_status_t alp_cnc_sub_object_assign(uint32_t lockedId, int16_t itemIndex, uint32_t newRefId);
01025 
01036         uint32_t alp_cnc_object_get_id(const char *nameStr);
01037 
01066         uint32_t alp_cnc_object_find_first(char *searchStr, uint32_t options, uint32_t * searchIdP, alp_status_t * errP);
01067 
01079         uint32_t alp_cnc_object_find_next(uint32_t searchId, alp_status_t * errP);
01080 
01090         void alp_cnc_object_find_close(uint32_t searchId);
01091 
01108         alp_status_t alp_cnc_object_find_all(uint32_t objectId, uint32_t options, int16_t * countP, AlpCncObjectInfo ** infoArrayP);
01109 
01121         alp_status_t alp_cnc_object_get_info(uint32_t recordId, AlpCncObjectInfo * infoP);
01122 
01132         static inline char* alp_cnc_builtin_gettext(char* name)
01133         {
01134                 bindtextdomain(CNC_BUILTIN_DOMAINNAME, ALP_SYSPATH_RO_SHARE_LOCALE);
01135                 return dgettext(CNC_BUILTIN_DOMAINNAME, name);
01136         }
01137 
01150         alp_status_t alp_cnc_object_set_info(uint32_t recordId, AlpCncObjectInfo * infoP, uint32_t flags);
01151 
01170         alp_status_t alp_cnc_object_insert_item(uint32_t lockedId, int16_t * atIndex, uint32_t itemId, AlpCncParameter parameters[]);
01171 
01183         alp_status_t alp_cnc_object_delete_item(uint32_t lockedId, uint32_t itemIndex);
01194         uint32_t alp_cnc_object_get_length(uint32_t lockedId);
01195 
01214         alp_status_t alp_cnc_object_get_item_index(uint32_t lockedId, int16_t * index, char *nameStr);
01215 
01228         uint32_t alp_cnc_object_get_item_id(uint32_t lockedId, int16_t index);
01229 
01245         alp_status_t alp_cnc_object_attach(uint32_t fromId, uint32_t toId);
01246 
01267         alp_status_t alp_cnc_object_move_item(uint32_t itemId, int16_t newIndexRelative);
01268 
01280         alp_status_t alp_cnc_object_get_dependencies(uint32_t objectId, uint32_t ** objectsPP, int16_t * countP);
01281 
01283 
01285 
01287 
01298         alp_status_t alp_cnc_interface_new(const char *nameStr, uint32_t * Id);
01299 
01310         alp_status_t alp_cnc_edge_new(uint32_t fromId, uint32_t toId);
01311 
01322 alp_status_t alp_cnc_edge_delete(uint32_t fromId, uint32_t toId);
01323 
01341         alp_status_t alp_cnc_object_ungroup(uint32_t profileId, bool regroupTags);
01342 
01344 
01345 
01347 
01349 
01365         uint32_t alp_cnc_object_decode(const char *profileName, const char *pathStr);
01366 
01377         alp_status_t alp_cnc_profile_new(const char *nameStr, uint32_t * Id);
01378 
01394         char *alp_cnc_object_encode(uint32_t profileId, int16_t index);
01395 
01409         alp_status_t alp_cnc_object_copy(uint32_t * profileId, int16_t from, int16_t to);
01410 
01412 
01414 
01416 
01435         alp_status_t alp_cnc_object_get_parameters(uint32_t lockedId, int16_t itemIndex, int8_t method, AlpCncParameter parameters[]);
01436 
01472         alp_status_t alp_cnc_object_set_parameters(uint32_t lockedId, int16_t itemIndex, AlpCncParameter parameters[]);
01473 
01480         void alp_cnc_parameters_init(AlpCncParameter parameters[], int32_t n);
01481 
01487         void alp_cnc_parameters_free(AlpCncParameter parameters[]);
01488 
01502         alp_status_t alp_cnc_channel_proxy_get_settings(uint8_t channel_id, int8_t index, AlpOMADM_PXLogicalType* PXLogical);
01512         alp_status_t alp_cnc_profile_proxy_get_settings(uint32_t profile_id, AlpOMADM_PXLogicalType* PXLogical);
01513 
01515 
01517 
01518 
01523 
01525 
01527 
01540 alp_status_t alp_cnc_job_end(uint32_t jobId, int nbArgs, char **args);
01541 
01553 int alp_cnc_job_end_init(uint32_t jobId);
01554 
01566 alp_status_t alp_cnc_job_end_fini(int fd, int nbArgs, char **args);
01567 
01569 
01571 
01576 
01578 
01580 
01588 alp_status_t alp_cnc_secret_new(const char * data,uint32_t profile_id,uint32_t parameter);
01589 
01596 alp_status_t alp_cnc_secret_delete(uint32_t profile_id,uint32_t parameter);
01597 
01605 alp_status_t alp_cnc_secret_edit(const char * data,uint32_t profile_id, uint32_t parameter);
01606 
01608 
01610 
01611 #ifdef __cplusplus
01612 }
01613 #endif
01614 
01615 #endif 

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

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