File: networksort.h

package info (click to toggle)
kismet 2008-05-R1-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,232 kB
  • ctags: 3,998
  • sloc: cpp: 33,568; sh: 5,544; ansic: 459; makefile: 457; perl: 62; sql: 41
file content (156 lines) | stat: -rw-r--r-- 3,847 bytes parent folder | download | duplicates (4)
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*
    This file is part of Kismet

    Kismet is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    Kismet is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Kismet; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef __NETWORKSORT_H__
#define __NETWORKSORT_H__

#include "config.h"
#include "packetracker.h"

class SortLastTime {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->last_time > y->last_time)
            return 1;
        return 0;
    }
};

class SortLastTimeLT {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->last_time < y->last_time)
            return 1;
        return 0;
    }
};


class SortFirstTime {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->first_time > y->first_time)
            return 1;
        return 0;
    }
};

class SortFirstTimeLT {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->first_time < y->first_time)
            return 1;
        return 0;
    }
};

class SortBSSID {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (y->bssid < x->bssid)
            return 1;
        return 0;
    }
};

class SortBSSIDLT {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->bssid < y->bssid)
            return 1;
        return 0;
    }
};


class SortSSID {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->ssid > y->ssid)
            return 1;
        return 0;
    }
};

class SortSSIDLT {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->ssid < y->ssid)
            return 1;
        return 0;
    }
};

class SortWEP {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->crypt_set > y->crypt_set)
            return 1;
        return 0;
    }
};

class SortChannel {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->channel < y->channel)
            return 1;
        return 0;
    }
};

class SortPacketsLT {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if ((x->llc_packets + x->data_packets) <
            (y->llc_packets + y->data_packets))
            return 1;
        return 0;
    }
};

class SortPackets {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if ((x->llc_packets + x->data_packets) >
            (y->llc_packets + y->data_packets))
            return 1;
        return 0;
    }
};

class SortQuality {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->quality > y->quality)
            return 1;
        return 0;
    }
};

class SortSignal {
public:
    inline bool operator() (const wireless_network *x, const wireless_network *y) const {
        if (x->signal > y->signal)
            return 1;
        return 0;
    }
};

#endif