Initial commit

FossilOrigin-Name: 093543d2bc5871b40e3fcc464555bd06931075af95fdd7ad0c44985fa01de497
This commit is contained in:
7u83@mail.ru 2016-04-09 12:21:16 +00:00
parent 1e6e4cb59b
commit 5464d95224
6 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,26 @@
#include "cw/action.h"
#include "cw/cw.h"
#include "cw/mavl.h"
int capwap_out_ac_ip_list(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
{
/* mbag_t ips = conn->local;
MAVLITER_DEFINE (it,ips);
mavliter_foreach(&it){
}
*/
return 0;
struct sockaddr sa;
sock_strtoaddr( "192.168.0.11", &sa);
cw_put_sockaddr(dst+4,(struct sockaddr_storage*)&sa);
return 4 + cw_put_elem_hdr(dst,CW_ELEM_AC_IPV4_LIST,4);
}

View File

@ -0,0 +1,2 @@
capwap80211_out

View File

@ -0,0 +1,24 @@
int cisco_in_telnet_ssh(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
struct sockaddr *from)
{
int enable=lw_get_byte(data);
int type = lw_get_byte(data+1);
switch (type){
case 0:
mbag_set_byte(conn->incomming,CIPWAP_ITEM_TELNET_ENABLE,enable);
break;
case 1:
mbag_set_byte(conn->incomming,CIPWAP_ITEM_SSH_ENABLE,enable);
break;
default:
cw_dbg(DBG_ELEM_ERR,"Unknown Telnet/SSH Type: %d",type);
break;
}
return 0;
}

View File

@ -0,0 +1,28 @@
#include "cw/action.h"
#include "cw/cw.h"
#include "cw/mavl.h"
int cisco_out_ac_ipv4_list(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
{
/* mbag_t ips = conn->local;
MAVLITER_DEFINE (it,ips);
mavliter_foreach(&it){
}
*/
struct sockaddr sa;
sock_strtoaddr( "192.168.0.11", &sa);
cw_put_sockaddr(dst+10,(struct sockaddr_storage*)&sa);
int l = 4;
return l + cw_put_elem_vendor_hdr(dst, a->vendor_id, a->elem_id, l);
}

View File

@ -0,0 +1,10 @@
#include "cw/capwap.h"
#include "cw/action.h"
#include "cw/cw.h"
int cisco_out_capwap_up(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
{
return cw_put_elem_radio_operational_state(dst,0xff,CW_RADIO_OPER_STATE_ENABLED_7,CW_RADIO_OPER_CAUSE_NORMAL);
}

View File

@ -0,0 +1,42 @@
#include "cw/sock.h"
#include "cw/lwapp_cisco.h"
#include "cw/capwap_cisco.h"
#include "cw/action.h"
#include "cw/vendors.h"
#include "cw/lw.h"
#include "cw/cw.h"
int cisco_out_manager_ip_addr(struct conn *conn,struct cw_action_out * a,uint8_t *dst)
{
uint8_t arr[]= {
0x00,0x40,0x96,0x00,0x00,0x68,0x00,0x40,0x96,0x00,0x00,0x87,0xC0,0xA8,0x00,0x5A,0x08,0x00,0x27,0x01,0xA0,0x83
};
uint8_t arr1[] = {
0xC0,0xA8,0x00,0x0B,0x08,0x00,0x27,0x01,0xA0,0x83
};
memcpy(dst+16,arr1,sizeof(arr1));
int l=sizeof(arr1);
l = l + lw_put_vendor(dst+10, LW_VENDOR_ID_CISCO, LW_CISCO_DOT11R_WLC_MAC_AND_IP, l);
return l+cw_put_elem_vendor_hdr(dst,CW_VENDOR_ID_CISCO,CW_CISCO_SPAM_VENDOR_SPECIFIC,l);
uint8_t *d=dst+16;
struct sockaddr ss;
sock_strtoaddr("192.168.0.11",&ss);
memcpy(d,&(((struct sockaddr_in *) &ss)->sin_addr),4);
l=4;
l = l + lw_put_vendor(dst+10, LW_VENDOR_ID_CISCO, LW_CISCO_MANAGER_IP_ADDR, l);
return l+cw_put_elem_vendor_hdr(dst,CW_VENDOR_ID_CISCO,CW_CISCO_SPAM_VENDOR_SPECIFIC,l);
}