LCOV - code coverage report
Current view: top level - src/fst - fst_iface.h (source / functions) Hit Total Coverage
Test: wpa_supplicant/hostapd combined for hwsim test run 1443382998 Lines: 36 36 100.0 %
Date: 2015-09-27 Functions: 17 17 100.0 %

          Line data    Source code
       1             : /*
       2             :  * FST module - FST interface object definitions
       3             :  * Copyright (c) 2014, Qualcomm Atheros, Inc.
       4             :  *
       5             :  * This software may be distributed under the terms of the BSD license.
       6             :  * See README for more details.
       7             :  */
       8             : 
       9             : 
      10             : #ifndef FST_IFACE_H
      11             : #define FST_IFACE_H
      12             : 
      13             : #include "utils/includes.h"
      14             : #include "utils/common.h"
      15             : #include "list.h"
      16             : #include "fst.h"
      17             : 
      18             : struct fst_iface {
      19             :         struct fst_group *group;
      20             :         struct fst_wpa_obj iface_obj;
      21             :         u8 own_addr[ETH_ALEN];
      22             :         struct wpabuf *mb_ie;
      23             :         char ifname[IFNAMSIZ + 1];
      24             :         struct fst_iface_cfg cfg;
      25             :         struct dl_list group_lentry;
      26             : };
      27             : 
      28             : struct fst_iface * fst_iface_create(struct fst_group *g, const char *ifname,
      29             :                                     const u8 *own_addr,
      30             :                                     const struct fst_wpa_obj *iface_obj,
      31             :                                     const struct fst_iface_cfg *cfg);
      32             : void fst_iface_delete(struct fst_iface *i);
      33             : 
      34       10868 : static inline struct fst_group * fst_iface_get_group(struct fst_iface *i)
      35             : {
      36       10868 :         return i->group;
      37             : }
      38             : 
      39       17160 : static inline const char * fst_iface_get_name(struct fst_iface *i)
      40             : {
      41       17160 :         return i->ifname;
      42             : }
      43             : 
      44        2273 : static inline const u8 * fst_iface_get_addr(struct fst_iface *i)
      45             : {
      46        2273 :         return i->own_addr;
      47             : }
      48             : 
      49        1093 : static inline const char * fst_iface_get_group_id(struct fst_iface *i)
      50             : {
      51        1093 :         return i->cfg.group_id;
      52             : }
      53             : 
      54         539 : static inline u8 fst_iface_get_priority(struct fst_iface *i)
      55             : {
      56         539 :         return i->cfg.priority;
      57             : }
      58             : 
      59           9 : static inline u32 fst_iface_get_llt(struct fst_iface *i)
      60             : {
      61           9 :         return i->cfg.llt;
      62             : }
      63             : 
      64         602 : static inline const struct wpabuf * fst_iface_get_mbie(struct fst_iface *i)
      65             : {
      66         602 :         return i->mb_ie;
      67             : }
      68             : 
      69        5790 : static inline const u8 * fst_iface_get_bssid(struct fst_iface *i)
      70             : {
      71        5790 :         return i->iface_obj.get_bssid(i->iface_obj.ctx);
      72             : }
      73             : 
      74        2588 : static inline void fst_iface_get_channel_info(struct fst_iface *i,
      75             :                                               enum hostapd_hw_mode *hw_mode,
      76             :                                               u8 *channel)
      77             : {
      78        2588 :         i->iface_obj.get_channel_info(i->iface_obj.ctx, hw_mode, channel);
      79        2588 : }
      80             : 
      81        1518 : static inline int fst_iface_get_hw_modes(struct fst_iface *i,
      82             :                                          struct hostapd_hw_modes **modes)
      83             : {
      84        1518 :         return i->iface_obj.get_hw_modes(i->iface_obj.ctx, modes);
      85             : }
      86             : 
      87        2621 : static inline void fst_iface_set_ies(struct fst_iface *i,
      88             :                                      const struct wpabuf *fst_ies)
      89             : {
      90        2621 :         i->iface_obj.set_ies(i->iface_obj.ctx, fst_ies);
      91        2621 : }
      92             : 
      93         956 : static inline int fst_iface_send_action(struct fst_iface *i,
      94             :                                         const u8 *addr, struct wpabuf *data)
      95             : {
      96         956 :         return i->iface_obj.send_action(i->iface_obj.ctx, addr, data);
      97             : }
      98             : 
      99             : static inline const struct wpabuf *
     100        1323 : fst_iface_get_peer_mb_ie(struct fst_iface *i, const u8 *addr)
     101             : {
     102        1323 :         return i->iface_obj.get_mb_ie(i->iface_obj.ctx, addr);
     103             : }
     104             : 
     105         318 : static inline void fst_iface_update_mb_ie(struct fst_iface *i,
     106             :                                           const u8 *addr,
     107             :                                           const u8 *buf, size_t size)
     108             : {
     109         318 :         return i->iface_obj.update_mb_ie(i->iface_obj.ctx, addr, buf, size);
     110             : }
     111             : 
     112        3004 : static inline const u8 * fst_iface_get_peer_first(struct fst_iface *i,
     113             :                                                   struct fst_get_peer_ctx **ctx,
     114             :                                                   Boolean mb_only)
     115             : {
     116        3004 :         return i->iface_obj.get_peer_first(i->iface_obj.ctx, ctx, mb_only);
     117             : }
     118             : 
     119         270 : static inline const u8 * fst_iface_get_peer_next(struct fst_iface *i,
     120             :                                                  struct fst_get_peer_ctx **ctx,
     121             :                                                  Boolean mb_only)
     122             : {
     123         270 :         return i->iface_obj.get_peer_next(i->iface_obj.ctx, ctx, mb_only);
     124             : }
     125             : 
     126             : Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr);
     127             : void fst_iface_attach_mbie(struct fst_iface *i, struct wpabuf *mbie);
     128             : enum mb_band_id fst_iface_get_band_id(struct fst_iface *i);
     129             : 
     130        2875 : static inline void * fst_iface_get_wpa_obj_ctx(struct fst_iface *i)
     131             : {
     132        2875 :         return i->iface_obj.ctx;
     133             : }
     134             : 
     135             : #endif /* FST_IFACE_H */

Generated by: LCOV version 1.10