-
Notifications
You must be signed in to change notification settings - Fork 2
/
common.h
78 lines (59 loc) · 1.37 KB
/
common.h
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
#ifndef WMAN_COMMON_H
#define WMAN_COMMON_H
#ifdef HAVE_LIBUSEFUL5_LIBUSEFUL_H
#include "libUseful-5/libUseful.h"
#else
#include "libUseful-4/libUseful.h"
#endif
#include <glob.h>
#define NET_WPA1 1
#define NET_WPA2 2
#define NET_RSN 4
#define NET_WEP 32
#define NET_ADHOC 128
#define NET_STORE 2048
#define NET_ASSOCIATED 4096
#define NET_JOINING 8192
#define NET_ENCRYPTED (NET_WPA1 | NET_WPA2 | NET_RSN | NET_WEP)
#define DEV_WIFI 1
typedef struct
{
char *Name;
int Flags;
char *Driver;
} TNetDev;
typedef struct
{
char *Interface;
char *MacAddress;
char *Address;
char *Netmask;
char *Gateway;
char *DNSServer;
char *ESSID;
char *AccessPoint;
char *CountryCode;
int Flags;
int Channel;
char *BitRates;
char *UserID;
char *Key;
float Quality;
float dBm;
} TNet;
extern ListNode *ConfiguredNets;
extern ListNode *Interfaces;
extern STREAM *StdIO;
typedef void (*INTERACTIVE_STATUS_CALLBACK)(TNetDev *Dev, const char *Text);
extern INTERACTIVE_STATUS_CALLBACK DisplayStatus;
void PidPathKill(const char *Path);
void PidFileKill(const char *AppName);
TNet *NetCreate();
void NetDestroy(void *p_Net);
const char *OutputNetQualityColor(TNet *Net);
char *OutputFormatNet(char *Output, TNet *Net);
int FrequencyToChannel(int freq);
void QueryRootPassword(const char *Prompt);
void NetSetESSID(TNet *Net, const char *ESSID);
char *FindCommandFromList(char *RetStr, const char *List);
#endif