Add ieee 80211 message element to configure request
This commit is contained in:
parent
45ca636d6f
commit
5e3856cd9c
@ -494,6 +494,42 @@ static int wtp_parsing_radio_configuration(config_setting_t* configElement, stru
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TX Power */
|
||||||
|
configSection = config_setting_get_member(configElement, "txpower");
|
||||||
|
if (configSection) {
|
||||||
|
radio->txpower.radioid = radio->radioid;
|
||||||
|
|
||||||
|
if (config_setting_lookup_int(configSection, "current", &configInt) == CONFIG_TRUE) {
|
||||||
|
if ((configInt >= 0) && (configInt <= 10000)) {
|
||||||
|
radio->txpower.currenttxpower = (uint16_t)configInt;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
configItems = config_setting_get_member(configElement, "supported");
|
||||||
|
if (configItems != NULL) {
|
||||||
|
int count = config_setting_length(configItems);
|
||||||
|
if ((count > 0) && (count <= CAPWAP_TXPOWERLEVEL_MAXLENGTH)) {
|
||||||
|
radio->txpowerlevel.radioid = radio->radioid;
|
||||||
|
radio->txpowerlevel.numlevels = (uint8_t)count;
|
||||||
|
|
||||||
|
for (i = 0; i < count; i++) {
|
||||||
|
int value = config_setting_get_int_elem(configItems, i);
|
||||||
|
if ((configInt >= 0) && (configInt <= 10000)) {
|
||||||
|
radio->txpowerlevel.powerlevel[i] = (uint8_t)value;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* WTP Radio Configuration */
|
/* WTP Radio Configuration */
|
||||||
radio->radioconfig.radioid = radio->radioid;
|
radio->radioconfig.radioid = radio->radioid;
|
||||||
|
|
||||||
|
@ -151,6 +151,8 @@ struct wtp_radio {
|
|||||||
struct capwap_80211_multidomaincapability_element multidomaincapability;
|
struct capwap_80211_multidomaincapability_element multidomaincapability;
|
||||||
struct capwap_80211_ofdmcontrol_element ofdmcontrol;
|
struct capwap_80211_ofdmcontrol_element ofdmcontrol;
|
||||||
struct capwap_80211_supportedrates_element supportedrates;
|
struct capwap_80211_supportedrates_element supportedrates;
|
||||||
|
struct capwap_80211_txpower_element txpower;
|
||||||
|
struct capwap_80211_txpowerlevel_element txpowerlevel;
|
||||||
struct capwap_80211_wtpradioconf_element radioconfig;
|
struct capwap_80211_wtpradioconf_element radioconfig;
|
||||||
struct capwap_80211_wtpradioinformation_element radioinformation;
|
struct capwap_80211_wtpradioinformation_element radioinformation;
|
||||||
};
|
};
|
||||||
|
@ -170,6 +170,7 @@ int wtp_dfa_state_join(struct capwap_parsed_packet* packet, struct timeout_contr
|
|||||||
|
|
||||||
/* */
|
/* */
|
||||||
int wtp_dfa_state_join_to_configure(struct capwap_parsed_packet* packet, struct timeout_control* timeout) {
|
int wtp_dfa_state_join_to_configure(struct capwap_parsed_packet* packet, struct timeout_control* timeout) {
|
||||||
|
int i;
|
||||||
struct capwap_header_data capwapheader;
|
struct capwap_header_data capwapheader;
|
||||||
struct capwap_packet_txmng* txmngpacket;
|
struct capwap_packet_txmng* txmngpacket;
|
||||||
int status = WTP_DFA_NO_PACKET;
|
int status = WTP_DFA_NO_PACKET;
|
||||||
@ -189,18 +190,55 @@ int wtp_dfa_state_join_to_configure(struct capwap_parsed_packet* packet, struct
|
|||||||
/* CAPWAP_ELEMENT_ACNAMEPRIORITY */ /* TODO */
|
/* CAPWAP_ELEMENT_ACNAMEPRIORITY */ /* TODO */
|
||||||
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_TRANSPORT, &g_wtp.transport);
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_TRANSPORT, &g_wtp.transport);
|
||||||
/* CAPWAP_ELEMENT_WTPSTATICIPADDRESS */ /* TODO */
|
/* CAPWAP_ELEMENT_WTPSTATICIPADDRESS */ /* TODO */
|
||||||
/* CAPWAP_ELEMENT_80211_ANTENNA */ /* TODO */
|
|
||||||
/* CAPWAP_ELEMENT_80211_DIRECTSEQUENCECONTROL */ /* TODO */
|
|
||||||
/* CAPWAP_ELEMENT_80211_MACOPERATION */ /* TODO */
|
|
||||||
/* CAPWAP_ELEMENT_80211_MULTIDOMAINCAPABILITY */ /* TODO */
|
|
||||||
/* CAPWAP_ELEMENT_80211_OFDMCONTROL */ /* TODO */
|
|
||||||
/* CAPWAP_ELEMENT_80211_SUPPORTEDRATES */ /* TODO */
|
|
||||||
/* CAPWAP_ELEMENT_80211_TXPOWER */ /* TODO */
|
|
||||||
/* CAPWAP_ELEMENT_80211_TXPOWERLEVEL */ /* TODO */
|
|
||||||
/* CAPWAP_ELEMENT_80211_WTP_RADIO_CONF */ /* TODO */
|
|
||||||
|
|
||||||
if (g_wtp.binding == CAPWAP_WIRELESS_BINDING_IEEE80211) {
|
if (g_wtp.binding == CAPWAP_WIRELESS_BINDING_IEEE80211) {
|
||||||
wtp_create_80211_wtpradioinformation_element(txmngpacket);
|
for (i = 0; i < g_wtp.radios->count; i++) {
|
||||||
|
struct wtp_radio* radio = (struct wtp_radio*)capwap_array_get_item_pointer(g_wtp.radios, i);
|
||||||
|
|
||||||
|
/* Set message element */
|
||||||
|
if ((radio->status == WTP_RADIO_ENABLED) && radio->radioinformation.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_WTPRADIOINFORMATION, &radio->radioinformation);
|
||||||
|
|
||||||
|
if (radio->radioinformation.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_ANTENNA, &radio->antenna);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (radio->directsequencecontrol.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_DIRECTSEQUENCECONTROL, &radio->directsequencecontrol);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (radio->macoperation.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_MACOPERATION, &radio->macoperation);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (radio->multidomaincapability.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_MULTIDOMAINCAPABILITY, &radio->multidomaincapability);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (radio->ofdmcontrol.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_OFDMCONTROL, &radio->ofdmcontrol);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (radio->supportedrates.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_SUPPORTEDRATES, &radio->supportedrates);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (radio->txpower.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_TXPOWER, &radio->txpower);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (radio->txpowerlevel.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_TXPOWERLEVEL, &radio->txpowerlevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (radio->radioconfig.radioid) {
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_WTP_RADIO_CONF, &radio->radioconfig);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
struct capwap_80211_wtpradioinformation_element element = { (uint8_t)radio->radioid, 0 };
|
||||||
|
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_WTPRADIOINFORMATION, &element);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CAPWAP_ELEMENT_VENDORPAYLOAD */ /* TODO */
|
/* CAPWAP_ELEMENT_VENDORPAYLOAD */ /* TODO */
|
||||||
|
Loading…
Reference in New Issue
Block a user