moved unsied files, compiles w/o waringins with clang
FossilOrigin-Name: 1189a474bfcc28195d888d7967ccfc50c812f194e1ee19e99d3cb244d666a19a
This commit is contained in:
34
src/cw/dot11/dot11_beacon.c
Normal file
34
src/cw/dot11/dot11_beacon.c
Normal file
@ -0,0 +1,34 @@
|
||||
#include "dot11.h"
|
||||
|
||||
|
||||
|
||||
|
||||
int dot11_create_beacon(uint8_t *dst)
|
||||
{
|
||||
uint8_t *d = dst;
|
||||
d+=dot11_put_frame_control(d,DOT11_FC_BEACON,0);
|
||||
d+=dot11_put_duration(d,0);
|
||||
d+=dot11_put_address(d,DOT11_BROADCAST_ADDRESS);
|
||||
uint8_t addr[6]={0x00,0x3a,0x99,0x02,0xfa,0xc0};
|
||||
d+=dot11_put_address(d,addr);
|
||||
d+=dot11_put_address(d,addr);
|
||||
d+=dot11_put_sequence_control(d,17);
|
||||
|
||||
d+=dot11_put_timestamp(d);
|
||||
d+=dot11_put_beacon_interval(d,100);
|
||||
d+=dot11_put_capability(d,DOT11_CAP_ESS | DOT11_CAP_SHORT_PREAMBLE);
|
||||
d+=dot11_put_ssid(d,(uint8_t*)"Hello Word",10);
|
||||
|
||||
|
||||
float brates[] = {2,4,5.5,0.0};
|
||||
float rates[] = {1,4,54,0.0};
|
||||
|
||||
d+=dot11_put_supported_rates(d,brates,rates);
|
||||
d+=dot11_put_dsss_param_set(d,1);
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
41
src/cw/dot11/format_dot11_fc.c
Normal file
41
src/cw/dot11/format_dot11_fc.c
Normal file
@ -0,0 +1,41 @@
|
||||
#include "dot11.h"
|
||||
#include "format.h"
|
||||
|
||||
|
||||
static int add_flag(char *dst,int fc, int flag, char *name,char **delim)
|
||||
{
|
||||
if (! (fc&flag) )
|
||||
return 0;
|
||||
int n = sprintf(dst,"%s%s",*delim,name);
|
||||
*delim=":";
|
||||
return n;
|
||||
}
|
||||
|
||||
int format_dot11_fc(char *dst, uint16_t fc)
|
||||
{
|
||||
char *d = dst;
|
||||
|
||||
d+=sprintf(d,"Ver: %d ",dot11_fc_get_version(fc));
|
||||
d+=sprintf(d,"Type: %d ",dot11_fc_get_type(fc));
|
||||
d+=sprintf(d,"Subtype: %d ",dot11_fc_get_subtype(fc));
|
||||
d+=sprintf(d,"Flags: [");
|
||||
|
||||
char *delim = "";
|
||||
|
||||
d+=add_flag(d,fc,DOT11_FC_FLAG_FROM_DS,"from_ds",&delim);
|
||||
d+=add_flag(d,fc,DOT11_FC_FLAG_TO_DS,"to_ds",&delim);
|
||||
d+=add_flag(d,fc,DOT11_FC_FLAG_MOREFRAGS,"more_frags",&delim);
|
||||
d+=add_flag(d,fc,DOT11_FC_FLAG_RETRY,"retry",&delim);
|
||||
d+=add_flag(d,fc,DOT11_FC_FLAG_POWERMGMT,"pwrmgmt",&delim);
|
||||
d+=add_flag(d,fc,DOT11_FC_FLAG_MOREDATA,"more data",&delim);
|
||||
d+=add_flag(d,fc,DOT11_FC_FLAG_PROTECTED,"protected",&delim);
|
||||
d+=add_flag(d,fc,DOT11_FC_FLAG_ORDER,"order",&delim);
|
||||
|
||||
d+=sprintf(d,"]");
|
||||
return d-dst;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user