forked from iosifpeterfi/openCAPWAP-OpenWRT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CWVendorPayloads.h
94 lines (81 loc) · 4.15 KB
/
CWVendorPayloads.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/************************************************************************************************
* Copyright (c) 2006-2009 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica *
* Universita' Campus BioMedico - Italy *
* *
* This program 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 2 of the License, or (at your option) any later version. *
* *
* This program 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 this *
* program; if not, write to the: *
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, *
* MA 02111-1307, USA. *
* *
* -------------------------------------------------------------------------------------------- *
* Project: Capwap
* Authors : Matteo Latini ([email protected])
* Donato Capitella ([email protected]) *
************************************************************************************************/
#ifndef __CAPWAP_VendorPayloads__
#define __CAPWAP_VendorPayloads__
/*#include "CWCommon.h"*/
#include "CWAC.h"
/***********************************************************************
* Vendor specific payloads types
* *********************************************************************/
#define CW_MSG_ELEMENT_VENDOR_SPEC_PAYLOAD_UCI 1
#define CW_MSG_ELEMENT_VENDOR_SPEC_PAYLOAD_WUM 2
/***********************************************************************
* UCI Server Port
* *********************************************************************/
#define UCI_SERVER_PORT 31337
typedef struct {
unsigned char command;
char *commandArgs;
char *response;
} CWVendorUciValues;
CWBool CWParseVendorPayload(CWProtocolMessage * msg, int len, CWProtocolVendorSpecificValues * valPtr);
CWBool CWParseUCIPayload(CWProtocolMessage * msg, CWVendorUciValues ** payloadPtr);
CWBool CWWTPSaveUCIValues(CWVendorUciValues * uciPayload, CWProtocolResultCode * resultCode);
CWBool CWAssembleWTPVendorPayloadUCI(CWProtocolMessage * msgPtr);
/*************************************************************************
* WTP Update Messages
*************************************************************************/
typedef struct {
unsigned char major_v;
unsigned char min_v;
unsigned char revision;
} mess_version_info;
typedef struct {
mess_version_info v_info;
unsigned int pack_size;
} mess_up_req;
typedef struct {
unsigned int seq_num;
unsigned int size;
unsigned char *buf;
} mess_cup;
typedef struct {
unsigned char type; /* Message type */
union {
mess_version_info v_resp;
mess_up_req up_req;
mess_cup cup;
} args;
} CWVendorWumValues;
#define _major_v_ args.v_resp.major_v
#define _minor_v_ args.v_resp.min_v
#define _revision_v_ args.v_resp.revision
#define _pack_size_ args.up_req.pack_size
#define _seq_num_ args.cup.seq_num
#define _cup_ args.cup.buf
#define _cup_fragment_size_ args.cup.size
#define CUP_FRAGMENT_SIZE 4000
//CWBool CWParseWUMPayload(CWProtocolMessage *msg, CWVendorUciValues **payloadPtr);
CWBool CWWTPSaveWUMValues(CWVendorWumValues * wumPayload, CWProtocolResultCode * resultCode);
CWBool CWAssembleWTPVendorPayloadWUM(CWProtocolMessage * msgPtr);
#endif