connectionMgr/src/connectPing.c File Reference

connectionMgr -According to the results of scanning networks, use the profile one by one to ping until it succeeds. More...

#include <string.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <liberdm/connectionMgrConstants.h>
#include "connectionMgrLog.h"
#include "connectScreenData.h"
#include "connectScreenProfiles.h"
#include "pingThread.h"
#include "connectPing.h"
#include "connectionMgr.h"

Go to the source code of this file.

Functions

static gboolean connect_ping_start (gpointer data)
static void connect_ping_done (pingContext_t *ctxt, pingStatus_t result)
static void on_ping_status_changed (GObject *object, GParamSpec *arg1, gpointer data)
static gboolean connect_ping_select_profile (pingContext_t *ctxt, int profileIndex)
static void connect_ping_unselect_profile (pingContext_t *ctxt)
pingContext_tconnect_ping_ctxt_new (void)
void connect_ping_ctxt_set_mode (pingContext_t *ctxt, pingMode_t mode)
void connect_ping_ctxt_set_connect_type (pingContext_t *ctxt, cmgrConnectType_t connectType)
void connect_ping_ctxt_set_get_initial_profile (pingContext_t *ctxt, get_initial_profile_t *get_initial_profile)
void connect_ping_ctxt_set_access_network_profiles_callbacks (pingContext_t *ctxt, get_n_network_profiles_t *get_n_network_profiles, get_network_profile_t *get_network_profile, select_next_regprofile_t *select_next_regprofile)
void connect_ping_ctxt_set_ui_callbacks (pingContext_t *ctxt, ui_update_status_t *ui_update_status, ui_display_settings_t *ui_display_settings, ui_select_profile_t *ui_select_profile, ui_unselect_all_profile_t *ui_unselect_all_profile)
void connect_ping_ctxt_set_done_callbacks (pingContext_t *ctxt, on_connected_t *on_connected, on_failed_all_t *on_failed_all)
static void free_network_pc_settings (ping_thread_parms *pingParms)
void connect_ping_ctxt_destory (pingContext_t *ctxt)
int connect_ping_get_pinging_profile_index_start (pingContext_t *ctxt)
void connect_ping_set_pinging_profile_index_start (pingContext_t *ctxt, int profileIndex)
int connect_ping_get_pinging_profile_index (pingContext_t *ctxt)
void connect_ping_set_pinging_profile_index (pingContext_t *ctxt, int profileIndex)
int connect_ping_get_selected_profile_index (pingContext_t *ctxt)
void connect_ping_set_selected_profile_index (pingContext_t *ctxt, int profileIndex)
static void connect_ping_select_first_profile (pingContext_t *ctxt)
static gboolean connect_ping_select_next_profile (pingContext_t *ctxt)
void connect_ping_select_initial_profile (pingContext_t *ctxt)
void connect_ping (pingContext_t *ctxt, gboolean delay)
gboolean connect_ping_in_pinging (pingContext_t *ctxt)
gboolean connect_ping_freeze_ui (pingContext_t *ctxt)
static gboolean delay_connect_ping_abort (gpointer data)
void connect_ping_abort (pingContext_t *ctxt)


Detailed Description

connectionMgr -According to the results of scanning networks, use the profile one by one to ping until it succeeds.

Copyright (C) 2007 iRex Technologies BV.

Definition in file connectPing.c.


Function Documentation

void connect_ping ( pingContext_t ctxt,
gboolean  delay 
)

Definition at line 429 of file connectPing.c.

00430 {
00431     CN_LOGPRINTF ("entry delay[%d]", delay);
00432 
00433     g_return_if_fail(ctxt != NULL);
00434 
00435     if (ctxt->pingServer)
00436     {
00437         CN_WARNPRINTF("Please wait while pinging...");
00438         return;
00439     }
00440 
00441     if (delay)
00442     {
00443         if (ctxt->pingTimeoutId > 0)
00444         {
00445             CN_LOGPRINTF("remove the old timeout function for pinging");
00446             g_source_remove(ctxt->pingTimeoutId);
00447             ctxt->pingTimeoutId = 0;
00448         }
00449 
00450         // begin to ping after 'delay' timeout
00451         ctxt->pingTimeoutId = g_timeout_add(delay, 
00452                                             connect_ping_start, 
00453                                             (gpointer)ctxt);
00454     }
00455     else
00456     {
00457         connect_ping_start(ctxt);
00458     }
00459 }

Here is the call graph for this function:

void connect_ping_abort ( pingContext_t ctxt  ) 

Definition at line 627 of file connectPing.c.

00628 {
00629     CN_LOGPRINTF ("entry");
00630    
00631     g_return_if_fail(ctxt != NULL);
00632 
00633     if (ctxt->pingServer)
00634     {
00635         CN_WARNPRINTF("Abort pinging...");
00636 
00637         gint profileIndex = connect_ping_get_pinging_profile_index(ctxt);
00638 
00639         if (ctxt->mode != backgroundPing_e && ctxt->ui_update_status)
00640         {
00641             // update the ui
00642             ctxt->ui_update_status(profileIndex, pingAborting_e);
00643         }
00644         
00645         // stop the pingThread
00646         pingThread_stop();
00647 
00648         // wait for pingThread done
00649         ctxt->pingAborting = TRUE;
00650         g_timeout_add(200, delay_connect_ping_abort, (gpointer)ctxt);
00651     }
00652 }

Here is the call graph for this function:

void connect_ping_ctxt_destory ( pingContext_t ctxt  ) 

Definition at line 167 of file connectPing.c.

00168 {
00169     ping_thread_parms *pingParms;
00170 
00171    if (ctxt)
00172    {
00173        if (ctxt->pingParms)
00174        {
00175            pingParms = ctxt->pingParms;
00176            free_network_pc_settings(pingParms);
00177            /*
00178            if (pingParms->pingStatus)
00179            {
00180                gtk_widget_destroy(pingParms->pingStatus);
00181            }
00182            */
00183 
00184            g_free(pingParms);
00185        }
00186        g_free(ctxt);
00187    }
00188 }

Here is the call graph for this function:

pingContext_t* connect_ping_ctxt_new ( void   ) 

Definition at line 51 of file connectPing.c.

00052 {
00053     pingContext_t *ctxt;
00054     GtkWidget *pingStatus;
00055 
00056     CN_LOGPRINTF("entry");
00057 
00058     ctxt = g_new0(pingContext_t, 1);
00059     g_assert(ctxt != NULL);
00060 
00061     // set the default values
00062     connect_ping_ctxt_set_mode(ctxt, undefPingMode_e);
00063     connect_ping_ctxt_set_connect_type(ctxt, cmgrConnectUnknown_e);
00064     connect_ping_ctxt_set_done_callbacks(ctxt, NULL, NULL);
00065 
00066     ctxt->selectedProfileIndex = -1;
00067     ctxt->pingingProfileIndexStart = -1;
00068     ctxt->pingingProfileIndex = -1;
00069     
00070     // initilize the pingParms 
00071     ctxt->pingParms = g_new0(ping_thread_parms, 1);
00072     g_assert(ctxt->pingParms != NULL);
00073 
00074     // ctxt->pingParms->pingStatus
00075     pingStatus = gtk_label_new ("ping-idle");
00076     g_signal_connect(pingStatus, "notify", 
00077                      G_CALLBACK (on_ping_status_changed), ctxt);
00078     ctxt->pingParms->pingStatus = pingStatus;
00079  
00080     // the other values are set to be NULL or zero implicitly by g_new0
00081 
00082     return ctxt;
00083 }

Here is the call graph for this function:

void connect_ping_ctxt_set_access_network_profiles_callbacks ( pingContext_t ctxt,
get_n_network_profiles_t get_n_network_profiles,
get_network_profile_t get_network_profile,
select_next_regprofile_t select_next_regprofile 
)

Definition at line 111 of file connectPing.c.

00115 {
00116     if (ctxt)
00117     {
00118         ctxt->get_n_network_profiles = get_n_network_profiles;
00119         ctxt->get_network_profile = get_network_profile;
00120         ctxt->select_next_regprofile = select_next_regprofile;
00121     }
00122 }

void connect_ping_ctxt_set_connect_type ( pingContext_t ctxt,
cmgrConnectType_t  connectType 
)

Definition at line 93 of file connectPing.c.

00095 {
00096     if (ctxt && (connectType >= 0) && (connectType < cmgrConnectUndef_e))
00097     {
00098         ctxt->connectType = connectType;
00099     }
00100 }

void connect_ping_ctxt_set_done_callbacks ( pingContext_t ctxt,
on_connected_t on_connected,
on_failed_all_t on_failed_all 
)

Definition at line 139 of file connectPing.c.

00142 {
00143     if (ctxt)
00144     {
00145        ctxt->on_connected = on_connected;
00146        ctxt->on_failed_all = on_failed_all;
00147     }
00148 }

void connect_ping_ctxt_set_get_initial_profile ( pingContext_t ctxt,
get_initial_profile_t get_initial_profile 
)

Definition at line 102 of file connectPing.c.

00104 {
00105     if (ctxt)
00106     {
00107         ctxt->get_initial_profile = get_initial_profile;
00108     }
00109 }

void connect_ping_ctxt_set_mode ( pingContext_t ctxt,
pingMode_t  mode 
)

Definition at line 85 of file connectPing.c.

00086 {
00087     if (ctxt && (mode >= 0) && (mode < undefPingMode_e))
00088     {
00089         ctxt->mode = mode;
00090     }
00091 }

void connect_ping_ctxt_set_ui_callbacks ( pingContext_t ctxt,
ui_update_status_t ui_update_status,
ui_display_settings_t ui_display_settings,
ui_select_profile_t ui_select_profile,
ui_unselect_all_profile_t ui_unselect_all_profile 
)

Definition at line 124 of file connectPing.c.

00129 {
00130     if (ctxt)
00131     {
00132         ctxt->ui_update_status = ui_update_status;
00133         ctxt->ui_display_settings = ui_display_settings;
00134         ctxt->ui_select_profile = ui_select_profile;
00135         ctxt->ui_unselect_all_profile = ui_unselect_all_profile;
00136     }
00137 }

static void connect_ping_done ( pingContext_t ctxt,
pingStatus_t  result 
) [static]

Definition at line 655 of file connectPing.c.

00656 {
00657     GtkWidget *pingStatus;
00658     int profileIndex, startIdx;
00659     gboolean same = TRUE;
00660     gboolean selected;
00661 
00662     CN_LOGPRINTF ("entry");
00663 
00664     g_return_if_fail(ctxt != NULL);
00665 
00666     if (ctxt->pingServer)
00667     {
00668         // set the ctxt->pingParms parameters
00669         pingStatus = ctxt->pingParms->pingStatus;
00670         gtk_label_set_text(GTK_LABEL(pingStatus), "ping-idle");
00671 
00672         // free the ctxt->pingParms parameters
00673         free_network_pc_settings(ctxt->pingParms);
00674 
00675         // update the ui
00676         profileIndex = connect_ping_get_pinging_profile_index(ctxt);
00677         g_return_if_fail(profileIndex != -1);
00678 
00679         if (ctxt->mode != backgroundPing_e && ctxt->ui_update_status)
00680         {
00681             ctxt->ui_update_status(profileIndex, result);
00682         }
00683    
00684         if (result == pingSucceeded_e)
00685         {
00686             ctxt->pingServer = FALSE;
00687             connect_ping_set_pinging_profile_index(ctxt, -1);
00688            
00689             if (ctxt->mode != backgroundPing_e 
00690                 && ctxt->ui_unselect_all_profile)
00691             {
00692                 ctxt->ui_unselect_all_profile();
00693             }
00694  
00695             if (ctxt->on_connected)
00696             {
00697                 ctxt->on_connected(profileIndex);
00698             }
00699         }
00700         else
00701         {
00702             if (ctxt->select_next_regprofile 
00703                 && !ctxt->select_next_regprofile(profileIndex))
00704             {
00705                 // connect using next profile
00706                  selected = connect_ping_select_next_profile(ctxt);
00707                  if (!selected)
00708                  {
00709                      connect_ping_select_first_profile(ctxt);
00710                  }            
00711                  same = FALSE;
00712             }
00713             
00714              // update the ui
00715              profileIndex = connect_ping_get_selected_profile_index(ctxt);
00716              CN_LOGPRINTF ("entry: selected profile [%d]", profileIndex);
00717              
00718              if (ctxt->mode != backgroundPing_e)
00719              {
00720                  if (same && ctxt->ui_display_settings)
00721                  {
00722                      ctxt->ui_display_settings(profileIndex, TRUE);
00723                  }
00724                  
00725                  if (ctxt->ui_select_profile)
00726                  {
00727                      ctxt->ui_select_profile(profileIndex);
00728                  }
00729              }
00730 
00731             // set the flag to be FALSE 
00732             // in order to setup the context for another round pinging
00733             ctxt->pingServer = FALSE;
00734             connect_ping_set_pinging_profile_index(ctxt, -1);
00735 
00736             startIdx = connect_ping_get_pinging_profile_index_start(ctxt);
00737             if (same || (profileIndex != startIdx))
00738             {
00739                 if (ctxt->mode == backgroundPing_e)
00740                 {
00741                     connect_ping(ctxt, FALSE);
00742                 }
00743                 else
00744                 {
00745                     connect_ping(ctxt, TRUE);
00746                 }
00747             }
00748             else
00749             {
00750                 CN_WARNPRINTF ("All profiles done, stop connecting");
00751                 connect_ping_unselect_profile (ctxt);
00752 
00753                 if (ctxt->mode != backgroundPing_e 
00754                     && ctxt->ui_unselect_all_profile)
00755                 {
00756                     ctxt->ui_unselect_all_profile();
00757                 }
00758                
00759                 if (ctxt->on_failed_all)
00760                 {
00761                     ctxt->on_failed_all();
00762                 }
00763             }
00764         }
00765     }
00766 }

Here is the call graph for this function:

gboolean connect_ping_freeze_ui ( pingContext_t ctxt  ) 

Definition at line 585 of file connectPing.c.

00586 {
00587     g_return_val_if_fail(ctxt != NULL, FALSE);
00588 
00589     CN_LOGPRINTF("return freeze = %d", ctxt->pingAborting);
00590     return ctxt->pingAborting;
00591 }

int connect_ping_get_pinging_profile_index ( pingContext_t ctxt  ) 

Definition at line 212 of file connectPing.c.

00213 {
00214     g_return_val_if_fail(ctxt != NULL, -1);
00215 
00216     CN_LOGPRINTF("entry profileIndex=%d", ctxt->pingingProfileIndex);
00217  
00218     return ctxt->pingingProfileIndex;
00219 }

int connect_ping_get_pinging_profile_index_start ( pingContext_t ctxt  ) 

Definition at line 193 of file connectPing.c.

00194 {
00195     g_return_val_if_fail(ctxt != NULL, -1);
00196 
00197     CN_LOGPRINTF("entry profileIndex=%d", ctxt->pingingProfileIndexStart);
00198 
00199     return ctxt->pingingProfileIndexStart;
00200 }

int connect_ping_get_selected_profile_index ( pingContext_t ctxt  ) 

Definition at line 231 of file connectPing.c.

00232 {
00233     g_return_val_if_fail(ctxt != NULL, -1);
00234 
00235     CN_LOGPRINTF("entry profileIndex=%d", ctxt->selectedProfileIndex);
00236     
00237     return ctxt->selectedProfileIndex;
00238 }

gboolean connect_ping_in_pinging ( pingContext_t ctxt  ) 

Definition at line 461 of file connectPing.c.

00462 {
00463     g_return_val_if_fail(ctxt, FALSE);
00464     
00465     CN_LOGPRINTF("return [%d]", ctxt->pingServer);
00466     return ctxt->pingServer;
00467 }

static void connect_ping_select_first_profile ( pingContext_t ctxt  )  [static]

Definition at line 250 of file connectPing.c.

00251 {
00252     int nProfiles = 0;
00253 
00254     CN_LOGPRINTF("entry");
00255 
00256     g_return_if_fail(ctxt != NULL);
00257     
00258     if (ctxt->get_n_network_profiles)
00259     { 
00260         nProfiles = ctxt->get_n_network_profiles();
00261     }
00262 
00263     if (nProfiles > 0)
00264     {
00265         connect_ping_select_profile(ctxt, 0);
00266     }
00267 }

Here is the call graph for this function:

void connect_ping_select_initial_profile ( pingContext_t ctxt  ) 

Definition at line 381 of file connectPing.c.

00382 {
00383     CN_LOGPRINTF ("entry");
00384 
00385     int profileIndex = 0;
00386     cmgrConnectType_t connectType;
00387     
00388     g_return_if_fail(ctxt != NULL);
00389 
00390     // select initial profile to use when connecting
00391     connectType = ctxt->connectType;
00392     if (connectType == cmgrConnectUnknown_e)
00393     {
00394         CN_WARNPRINTF("Unknown connect type[%d].", connectType);
00395 
00396         // edit mode of iDS/PC unknown: no profile selected
00397         connect_ping_unselect_profile (ctxt);
00398     }
00399     else
00400     {
00401         if (ctxt->get_initial_profile)
00402         {
00403             profileIndex = ctxt->get_initial_profile();
00404         }
00405         
00406         connect_ping_select_profile(ctxt, profileIndex);                
00407         connect_ping_set_pinging_profile_index_start(ctxt, profileIndex);      
00408 
00409         if (ctxt->mode != backgroundPing_e && ctxt->ui_select_profile)
00410         {
00411             ctxt->ui_select_profile(profileIndex);
00412         }
00413     }
00414 }

Here is the call graph for this function:

static gboolean connect_ping_select_next_profile ( pingContext_t ctxt  )  [static]

Definition at line 286 of file connectPing.c.

00287 {
00288     CN_LOGPRINTF("entry");
00289 
00290     gint  profileIndex;
00291     guint nProfiles;
00292     gboolean selected;
00293 
00294     g_return_val_if_fail(ctxt != NULL, FALSE);
00295 
00296     selected = FALSE;
00297     profileIndex = connect_ping_get_selected_profile_index(ctxt);
00298     if (ctxt->get_n_network_profiles)
00299     {
00300         nProfiles = ctxt->get_n_network_profiles();
00301     }
00302     else
00303     {
00304         nProfiles = 0;
00305     }
00306     if ((profileIndex >= 0) && (profileIndex < nProfiles))
00307     {
00308         if ((profileIndex + 1) < nProfiles)
00309         {
00310             connect_ping_select_profile(ctxt, profileIndex+1);
00311             selected = TRUE;
00312         }
00313     }
00314 
00315     return selected;
00316 }

Here is the call graph for this function:

static gboolean connect_ping_select_profile ( pingContext_t ctxt,
int  profileIndex 
) [static]

Definition at line 353 of file connectPing.c.

00355 {
00356     CN_LOGPRINTF("entry");
00357 
00358     guint nProfiles;
00359     gboolean selected;
00360     
00361     g_return_val_if_fail(ctxt != NULL, FALSE);
00362 
00363     selected = FALSE;
00364     if (ctxt->get_n_network_profiles)
00365     {
00366         nProfiles = ctxt->get_n_network_profiles();
00367     }
00368     else
00369     {
00370         nProfiles = 0;
00371     }
00372     if ((profileIndex >= 0) && (profileIndex < nProfiles))
00373     {
00374         connect_ping_set_selected_profile_index(ctxt, profileIndex);
00375         selected = TRUE;
00376     }
00377     return selected;
00378 }

Here is the call graph for this function:

void connect_ping_set_pinging_profile_index ( pingContext_t ctxt,
int  profileIndex 
)

Definition at line 221 of file connectPing.c.

00223 {
00224     g_return_if_fail(ctxt != NULL);
00225 
00226     CN_LOGPRINTF("entry profileIndex[%d]", profileIndex);
00227     
00228     ctxt->pingingProfileIndex = profileIndex;
00229 }

void connect_ping_set_pinging_profile_index_start ( pingContext_t ctxt,
int  profileIndex 
)

Definition at line 202 of file connectPing.c.

00204 {
00205     g_return_if_fail(ctxt != NULL);
00206 
00207     CN_LOGPRINTF("entry[%d]", profileIndex);
00208  
00209     ctxt->pingingProfileIndexStart = profileIndex;
00210 }

void connect_ping_set_selected_profile_index ( pingContext_t ctxt,
int  profileIndex 
)

Definition at line 240 of file connectPing.c.

00242 {
00243     g_return_if_fail(ctxt != NULL);
00244 
00245     CN_LOGPRINTF("entry profileIndex[%d]", profileIndex);
00246     
00247     ctxt->selectedProfileIndex = profileIndex;
00248 }

static gboolean connect_ping_start ( gpointer  data  )  [static]

Definition at line 470 of file connectPing.c.

00471 {
00472     pingContext_t*          ctxt;
00473     int                     profileIndex;
00474     gboolean                ok;
00475     const networkProfile_t* settings = NULL;
00476     regNetworkProfile_t*    regSettings = NULL;
00477     const regPCProfile_t *pcshare = NULL;
00478 
00479     ctxt = (pingContext_t*)data;
00480     g_return_val_if_fail(ctxt != NULL, FALSE);
00481 
00482     // set the ctxt->pingParms parameters
00483     profileIndex = connect_ping_get_selected_profile_index(ctxt);
00484     CN_LOGPRINTF ("entry: selected profile [%d]", profileIndex);
00485     g_return_val_if_fail (profileIndex != -1, FALSE);
00486 
00487     if (ctxt->get_network_profile)
00488     {
00489         settings = ctxt->get_network_profile(profileIndex);
00490     }
00491     g_return_val_if_fail(settings != NULL, FALSE);
00492 
00493     // free the old network settings and pcshare settings
00494     free_network_pc_settings(ctxt->pingParms);
00495 
00496     // get the network settings and pcshare settings if needed
00497     if (settings->nRegProfiles > 0
00498         && settings->regSettingsList
00499         && settings->regIndexList
00500         && ((settings->nActiveIndex >= 0) 
00501         && (settings->nActiveIndex < settings->nRegProfiles)))
00502     {
00503         regSettings = settings->regSettingsList[settings->nActiveIndex];
00504         ctxt->pingParms->settings = erRegDupNetworkProfile (regSettings);
00505         CN_LOGPRINTF("settings->regIndexList[%d]=%d", 
00506                       settings->nActiveIndex,
00507                       settings->regIndexList[settings->nActiveIndex]);
00508     }
00509     else
00510     {
00511         CN_LOGPRINTF("settings->scanSettings->encryption=%d", 
00512                      settings->scanSettings->encryption);
00513         if (connect_data_get_ac_wlan() 
00514             && settings->scanSettings 
00515             && settings->scanSettings->encryption == encr_none_t)
00516         {
00517             CN_LOGPRINTF("here");
00518 
00519             regSettings = network_spec_to_reg_network(settings->scanSettings);
00520             ctxt->pingParms->settings = erRegDupNetworkProfile(regSettings);
00521             erRegFreeNetworkProfile(regSettings);
00522             regSettings = NULL;
00523         }
00524     }
00525 
00526     // set the flag to be TRUE
00527     ctxt->pingServer = TRUE;
00528     connect_ping_set_pinging_profile_index(ctxt, profileIndex);
00529     
00530     if (ctxt->pingParms->settings)
00531     {
00532         if (ctxt->mode != backgroundPing_e && ctxt->ui_update_status)
00533         {
00534             ctxt->ui_update_status(profileIndex, pingConnecting_e);
00535         }
00536 
00537         pcshare = common_data_get_pcsharedata(0);
00538         if (pcshare && ctxt->connectType == cmgrConnectPCShare_e)
00539         {
00540             ctxt->pingParms->pcshare = erRegDupPCProfile (pcshare);
00541         }
00542         else
00543         {
00544             ctxt->pingParms->pcshare = NULL;
00545         }
00546 
00547         // start Ping thread
00548         pcshare = ctxt->pingParms->pcshare;
00549         CN_WARNPRINTF ("profile [%s] pcshare [%s] [%s]",
00550                         ctxt->pingParms->settings->name,
00551                         pcshare ? pcshare->pcname : "",
00552                         pcshare ? pcshare->sharename : "");
00553         ok = pingThread_start(ctxt->pingParms);
00554         if (ok)
00555         {
00556             CN_LOGPRINTF("Succeeded to start ping thread");
00557         }
00558         else
00559         {
00560             CN_ERRORPRINTF ("Failed to start ping thread");
00561         }
00562     }
00563     else
00564     {
00565         CN_LOGPRINTF("The %dth profile is the one by scanning,"
00566                      " but it has no corresponding profile in registry. "
00567                      "Skipped it. It can be used by changing the settings "
00568                      "or filling in the encryption key. ", 
00569                      profileIndex);
00570         if (settings->scanSettings 
00571             && settings->scanSettings->encryption == encr_none_t)
00572         {
00573             connect_ping_done(ctxt, pingSkipped_e);
00574         }
00575         else
00576         {
00577             connect_ping_done(ctxt, pingNeedKey_e);
00578         }
00579     }
00580 
00581     ctxt->pingTimeoutId = 0;
00582     return FALSE;
00583 }

Here is the call graph for this function:

static void connect_ping_unselect_profile ( pingContext_t ctxt  )  [static]

Definition at line 416 of file connectPing.c.

00417 {
00418     CN_LOGPRINTF ("entry");
00419 
00420     g_return_if_fail(ctxt != NULL);
00421 
00422     connect_ping_set_selected_profile_index(ctxt, -1);
00423 }

Here is the call graph for this function:

static gboolean delay_connect_ping_abort ( gpointer  data  )  [static]

Definition at line 593 of file connectPing.c.

00594 {
00595     pingContext_t* ctxt = (pingContext_t*)data;
00596     g_return_val_if_fail(ctxt != NULL, FALSE);
00597 
00598     gboolean ret = TRUE;  // TRUE = please call again
00599     gint profileIndex = connect_ping_get_pinging_profile_index(ctxt);
00600 
00601     // wait the pingThread aborting
00602     if (!pingThread_stopped())
00603     {
00604         CN_LOGPRINTF("call me later...");
00605     }
00606     else
00607     {
00608         ctxt->pingAborting = FALSE;
00609 
00610         if (ctxt->mode != backgroundPing_e && ctxt->ui_update_status)
00611         {
00612             // update the ui
00613             ctxt->ui_update_status(profileIndex, pingAborted_e);
00614         }
00615         
00616         // no more ping ongoing
00617         ctxt->pingServer = FALSE;
00618         connect_ping_set_pinging_profile_index(ctxt, -1);
00619 
00620         ret = FALSE;  // FALSE = don't call me again
00621     }
00622 
00623     return ret;
00624 }

Here is the call graph for this function:

static void free_network_pc_settings ( ping_thread_parms pingParms  )  [static]

Definition at line 150 of file connectPing.c.

00151 {
00152     regNetworkProfile_t *settings;
00153     regPCProfile_t *pcshare;
00154 
00155     if (pingParms)
00156     {
00157        settings = (regNetworkProfile_t*)pingParms->settings;
00158        erRegFreeNetworkProfile(settings);
00159        pingParms->settings = NULL;
00160            
00161        pcshare = (regPCProfile_t*)pingParms->pcshare;
00162        erRegFreePCProfile(pcshare);
00163        pingParms->pcshare = NULL;
00164     }
00165 }

Here is the call graph for this function:

static void on_ping_status_changed ( GObject *  object,
GParamSpec *  arg1,
gpointer  data 
) [static]

Definition at line 769 of file connectPing.c.

00772 {
00773     CN_LOGPRINTF ("entry");
00774 
00775     pingContext_t* ctxt = (pingContext_t*)data;
00776     g_return_if_fail(ctxt != NULL);
00777 
00778     const char *name = arg1->name;
00779     g_return_if_fail (strcmp (name, "label") == 0);
00780 
00781     const char *pingStatus;
00782     pingStatus = gtk_label_get_text (GTK_LABEL (object));
00783     CN_LOGPRINTF ("pingStatus [%s]\n", pingStatus);
00784 
00785     if (strcmp(pingStatus, "ping-done-ok") == 0)
00786     {
00787         connect_ping_done(ctxt, pingSucceeded_e);
00788     }
00789     else if (strcmp(pingStatus, "ping-done-error") == 0)
00790     {
00791         connect_ping_done(ctxt, pingFailed_e);
00792     }
00793     else if (strcmp(pingStatus, "ping-pcshare-error") == 0)
00794     {
00795         connect_ping_done (ctxt, pingFailedPCShare_e);
00796     }
00797     else if (strcmp(pingStatus, "ping-network-error") == 0)
00798     {
00799         connect_ping_done(ctxt, pingFailedNetwork_e);
00800     }
00801     else if(strcmp (pingStatus, "ping-done-abort") == 0)
00802     {
00803         CN_LOGPRINTF("ping-done-abort");
00804     }
00805     else
00806     {
00807         // ping-idle
00808         /* ignore */ ;
00809     }
00810 }

Here is the call graph for this function:


Generated on Sun Dec 14 17:15:59 2008 by  doxygen 1.5.6