From 89e80e0a4471c0f79675bf24a940188071697bec Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Tue, 7 Apr 2015 05:48:17 +0000 Subject: [PATCH] Inital... FossilOrigin-Name: 2863fb7447b0a424504431b4db4f69f06b56d93fedc126b343484e0e0a8f123a --- src/capwap/capwap_actions_wtp.c | 100 +++++++++++++++++++++++++++++++ src/capwap/capwap_strings_item.c | 9 +++ 2 files changed, 109 insertions(+) create mode 100644 src/capwap/capwap_actions_wtp.c create mode 100644 src/capwap/capwap_strings_item.c diff --git a/src/capwap/capwap_actions_wtp.c b/src/capwap/capwap_actions_wtp.c new file mode 100644 index 00000000..c9f421cc --- /dev/null +++ b/src/capwap/capwap_actions_wtp.c @@ -0,0 +1,100 @@ +/* + This file is part of libcapwap. + + libcapwap is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + libcapwap is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Foobar. If not, see . + +*/ + + +#include "capwap.h" +#include "action.h" +#include "capwap_items.h" +#include "capwap_actions.h" +#include "strheap.h" + + + +cw_action_in_t capwap_actions_wtp_in[] = { + + + /* ------------------------------------------------------------------------------- */ + + /* Message Discovery Request */ + {0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_RESPONSE, 0, + 0, 0} + , + /* Element: AC Name */ + {0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_RESPONSE, + CW_ACTION_IN_AC_NAME, 1} + , + + /* Element: Vendor Specific */ + {0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_RESPONSE, + CW_ACTION_IN_VENDOR_SPECIFIC_PAYLOAD, 1} + , + + + + + {0, 0, 0} +}; + + + + +cw_action_out_t capwap_actions_wtp_out[] = { + + {CW_MSG_DISCOVERY_REQUEST, CW_ITEM_NONE} + , + + /* AC Name */ + {CW_MSG_DISCOVERY_REQUEST, CW_ITEM_DISCOVERY_TYPE, 0, + CW_ELEM_DISCOVERY_TYPE, cw_out_generic, cw_out_get_local} + , + + + /* AC Name */ + {CW_MSG_DISCOVERY_REQUEST, CW_ITEM_WTP_BOARD_DATA, 0, + CW_ELEM_WTP_BOARD_DATA, cw_out_wtp_board_data, cw_out_get_local} + , + + + + {0, 0} + +}; + + + + + +int cw_register_actions_capwap_wtp(struct cw_actiondef *def) +{ + def->in = cw_actionlist_in_create(); + def->out = cw_actionlist_out_create(); + def->strmsg = cw_strheap_create(); + def->strelem = cw_strheap_create(); + + cw_actionlist_in_register_actions(def->in, capwap_actions_wtp_in); + cw_actionlist_out_register_actions(def->out, capwap_actions_wtp_out); + + int rc; + rc = cw_strheap_register_strings(def->strmsg, capwap_strings_msg); + rc += cw_strheap_register_strings(def->strelem, capwap_strings_elem); + + + printf("Registered %d strings\n", rc); + + return 1; +} diff --git a/src/capwap/capwap_strings_item.c b/src/capwap/capwap_strings_item.c new file mode 100644 index 00000000..14f384f7 --- /dev/null +++ b/src/capwap/capwap_strings_item.c @@ -0,0 +1,9 @@ +struct cw_str capwap_strings_item[] = { + + {CW_ITEM_AC_DESCRIPTOR, "AC Descriptor"}, + {CW_ITEM_AC_IPV4_LIST, "AC IPv4 List"}, + {CW_ITEM_WTP_DESCRIPTOR,"WTP Descriptor"}, + + + +}