LCOV - code coverage report
Current view: top level - wpa_supplicant - autoscan_periodic.c (source / functions) Hit Total Coverage
Test: wpa_supplicant/hostapd combined for hwsim test run 1393793999 Lines: 0 25 0.0 %
Date: 2014-03-02 Functions: 0 4 0.0 %
Branches: 0 8 0.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * WPA Supplicant - auto scan periodic module
       3                 :            :  * Copyright (c) 2012, Intel Corporation. All rights reserved.
       4                 :            :  *
       5                 :            :  * This software may be distributed under the terms of the BSD license.
       6                 :            :  * See README for more details.
       7                 :            :  */
       8                 :            : 
       9                 :            : #include "includes.h"
      10                 :            : 
      11                 :            : #include "common.h"
      12                 :            : #include "wpa_supplicant_i.h"
      13                 :            : #include "autoscan.h"
      14                 :            : 
      15                 :            : 
      16                 :            : struct autoscan_periodic_data {
      17                 :            :         int periodic_interval;
      18                 :            : };
      19                 :            : 
      20                 :            : 
      21                 :          0 : static int autoscan_periodic_get_params(struct autoscan_periodic_data *data,
      22                 :            :                                         const char *params)
      23                 :            : {
      24                 :            :         int interval;
      25                 :            : 
      26         [ #  # ]:          0 :         if (params == NULL)
      27                 :          0 :                 return -1;
      28                 :            : 
      29                 :          0 :         interval = atoi(params);
      30                 :            : 
      31         [ #  # ]:          0 :         if (interval < 0)
      32                 :          0 :                 return -1;
      33                 :            : 
      34                 :          0 :         data->periodic_interval = interval;
      35                 :            : 
      36                 :          0 :         return 0;
      37                 :            : }
      38                 :            : 
      39                 :            : 
      40                 :          0 : static void * autoscan_periodic_init(struct wpa_supplicant *wpa_s,
      41                 :            :                                      const char *params)
      42                 :            : {
      43                 :            :         struct autoscan_periodic_data *data;
      44                 :            : 
      45                 :          0 :         data = os_zalloc(sizeof(struct autoscan_periodic_data));
      46         [ #  # ]:          0 :         if (data == NULL)
      47                 :          0 :                 return NULL;
      48                 :            : 
      49         [ #  # ]:          0 :         if (autoscan_periodic_get_params(data, params) < 0) {
      50                 :          0 :                 os_free(data);
      51                 :          0 :                 return NULL;
      52                 :            :         }
      53                 :            : 
      54                 :          0 :         wpa_printf(MSG_DEBUG, "autoscan periodic: interval is %d",
      55                 :            :                    data->periodic_interval);
      56                 :            : 
      57                 :          0 :         return data;
      58                 :            : }
      59                 :            : 
      60                 :            : 
      61                 :          0 : static void autoscan_periodic_deinit(void *priv)
      62                 :            : {
      63                 :          0 :         struct autoscan_periodic_data *data = priv;
      64                 :            : 
      65                 :          0 :         os_free(data);
      66                 :          0 : }
      67                 :            : 
      68                 :            : 
      69                 :          0 : static int autoscan_periodic_notify_scan(void *priv,
      70                 :            :                                          struct wpa_scan_results *scan_res)
      71                 :            : {
      72                 :          0 :         struct autoscan_periodic_data *data = priv;
      73                 :            : 
      74                 :          0 :         wpa_printf(MSG_DEBUG, "autoscan periodic: scan result notification");
      75                 :            : 
      76                 :          0 :         return data->periodic_interval;
      77                 :            : }
      78                 :            : 
      79                 :            : 
      80                 :            : const struct autoscan_ops autoscan_periodic_ops = {
      81                 :            :         .name = "periodic",
      82                 :            :         .init = autoscan_periodic_init,
      83                 :            :         .deinit = autoscan_periodic_deinit,
      84                 :            :         .notify_scan = autoscan_periodic_notify_scan,
      85                 :            : };

Generated by: LCOV version 1.9