summaryrefslogtreecommitdiff
path: root/cesar/cp/sta/mgr/inc/net.h
blob: cdc91d4b86d1107c284b3757d569d731d627a3ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef cp_sta_mgr_inc_net
#define cp_sta_mgr_inc_net
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp/sta/mgr/inc/net.h
 * \brief   Private Network data.
 * \ingroup cp_sta_mgr
 *
 * Get all the data about an AVLN.
 *
 * Context of a Network.
 */

#include "lib/set.h"
#include "lib/slab.h"

/** Enumerator for the mac to tei table in the CL. */
enum cp_mactotei_tags_t
{
    CP_MACTOTEI_TAGS_LIST,
    CP_MACTOTEI_TAGS_BRIDGE,
    CP_MACTOTEI_TAGS_MAX
};


struct cp_net_t
{
    /** AVLN's SNID. */
    cp_snid_t snid;

    /** AVLN's NID. */
    cp_nid_t nid;

    /** The pointer to the CCo station. */
    cp_sta_t * cco;

    /** the pointer to the Pco station. */
    cp_sta_t * pco;

    /** The pointer to the UCCo station. */
    cp_sta_t *ucco;

    /** The list of associated stations in the AVLN. */
    set_t associated_stas;

    /** Th list of unassociated stations in the AVLN. */
    set_t unassociated_stas;

    /** Present flag. */
    bool present;

    /** AVLN slot id. */
    u8 avln_slot_id;

    /**
     * Slot usage mask read in the AVLN central beacon.
     */
    u8 avln_slot_usage;

    /**
     * Number of station in the network.
     */
    u8 num_stas;

    /**
     * Number of visible stations in the AVLN, correspond to the station
     * visible or discovered by the station.
     */
    u8 num_visible_stas;

    /**
     * The network mode.
     */
    cp_net_network_mode_t network_mode;

    /**
     * Access mode of the AVLN.
     */
    hpav_access_t access;

    /**
     * Number of associated stations in the net.
     */
    uint num_associated_stas;
};

BEGIN_DECLS

/**
 * Remove the station from the set of the network, and return the current
 * reference of the station.
 * \param  ctx  the module context.
 * \param  tei  the station's TEI.
 * \return  the station reference used by the net to handle the station.
 */
cp_sta_t *
cp_net_release_station (cp_t *ctx, cp_net_t *net, cp_tei_t tei);

END_DECLS

#endif /* cp_sta_mgr_inc_net */