1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use Net::WLAN qw/:all/;
# enumerate the WLAN interfaces attached to your Linux box
@interfaces = wlan_enum;
# set all your interfaces to channel 7
$_->channel(7) for @interfaces;
# set the configuration of ethX
$ethX = Net::WLAN::Interface->new("ethX");
$ethX->config(
Essid => 'NEW_ESSID',
Channel => 7,
Mode => $IW_MODE_MASTER,
);
$ethX->print;
# scan on an interface and print the name and adress of all WLANs seen
print "Found WLAN: " . $_->{Name} . " (" . $_->{Address} . ")\n"
foreach wlan_scan("ethX");
1
2
3
4
5
6
7
Skip blib/lib/Net/WLAN/IWLib.pod (unchanged)
Skip blib/lib/Net/WLAN/IWLib.pm (unchanged)
cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC "-I/usr/lib/perl/5.18/CORE" -DSWIG IWLib_wrap.c
IWLib_wrap.c:1046:22: fatal error: wireless.h: No such file or directory
#include "wireless.h"
^
compilation terminated.
QuotePREREQUISITES:
You must have a working installation of the Linux Wireless Extensions package,
version 27, before using this module. You can download it from:
http://www.hpl.hp.com/personal/Jean_Tourrilhes/Lin...
or you can as well install it from the precompiled package of your favorite
distro. Note that you also need the -dev package in this case.
Moreover, if you are in a need to re-generate the SWIG interface code, you
naturally need a working SWIG (version 1.3 or higher) install, too.
1
2
3
4
5
ExtUtils::MakeMaker::VERSION = 6.66
Checking if your kit is complete...
Looks good
Writing Makefile for Net::WLAN::IWLib
Writing MYMETA.yml and MYMETA.json
1
2
3
4
5
6
DSWIG IWLib_wrap.c
IWLib_wrap.c:1046:22: fatal error: wireless.h: No such file or directory
#include "wireless.h"
^
compilation terminated.
make: *** [IWLib_wrap.o] Error 1
1
2
3
DSWIG IWLib_wrap.c
IWLib_wrap.c:1047:19: fatal error: iwlib.h: No such file or directory
#include "iwlib.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
cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC "-I/usr/lib/perl/5.18/CORE" -DSWIG IWLib_wrap.c
In file included from wireless.h:74:0,
from IWLib_wrap.c:1046:
/usr/include/net/if.h:44:5: error: expected identifier before numeric constant
IFF_UP = 0x1, /* Interface is up. */
^
In file included from iwlib.h:58:0,
from IWLib_wrap.c:1047:
/usr/include/net/if.h:111:8: error: redefinition of 'struct ifmap'
struct ifmap
^
In file included from wireless.h:74:0,
from IWLib_wrap.c:1046:
/usr/include/linux/if.h:143:8: note: originally defined here
struct ifmap {
^
In file included from iwlib.h:58:0,
from IWLib_wrap.c:1047:
/usr/include/net/if.h:126:8: error: redefinition of 'struct ifreq'
struct ifreq
^
In file included from wireless.h:74:0,
from IWLib_wrap.c:1046:
/usr/include/linux/if.h:177:8: note: originally defined here
struct ifreq {
^
In file included from iwlib.h:58:0,
from IWLib_wrap.c:1047:
/usr/include/net/if.h:176:8: error: redefinition of 'struct ifconf'
struct ifconf
^
In file included from wireless.h:74:0,
from IWLib_wrap.c:1046:
/usr/include/linux/if.h:226:8: note: originally defined here
struct ifconf {
^
IWLib_wrap.c: In function 'iw_address_ntoa':
IWLib_wrap.c:1107:5: warning: return makes pointer from integer without a cast [enabled by default]
return iw_ether_ntoa( (struct ether_addr*)(addr->sa_data) );
^
IWLib_wrap.c: In function '_wrap_iw_print_pm_value':
IWLib_wrap.c:11593:9: error: too few arguments to function 'iw_print_pm_value'
iw_print_pm_value(arg1,arg2,arg3,arg4);
^
In file included from IWLib_wrap.c:1047:0:
iwlib.h:390:2: note: declared here
iw_print_pm_value(char * buffer,
^
IWLib_wrap.c: In function '_wrap_iw_print_retry_value':
IWLib_wrap.c:11647:9: error: too few arguments to function 'iw_print_retry_value'
iw_print_retry_value(arg1,arg2,arg3,arg4);
^
In file included from IWLib_wrap.c:1047:0:
iwlib.h:401:2: note: declared here
iw_print_retry_value(char * buffer,
^
IWLib_wrap.c: In function '_wrap_iw_print_timeval':
IWLib_wrap.c:11677:44: error: too few arguments to function 'iw_print_timeval'
iw_print_timeval(arg1,arg2,(struct timeval const *)arg3);
^
In file included from IWLib_wrap.c:1047:0:
iwlib.h:408:2: note: declared here
iw_print_timeval(char * buffer,
^
IWLib_wrap.c: In function '_wrap_iw_ether_ntoa':
IWLib_wrap.c:11821:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
result = (char *)iw_ether_ntoa((struct ether_addr const *)arg1);
^
IWLib_wrap.c: In function '_wrap_iw_pr_ether':
IWLib_wrap.c:12195:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
result = (char *)iw_pr_ether(arg1,(unsigned char const *)arg2);