2015-03-24 20:15:11 +01:00
|
|
|
/*
|
|
|
|
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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Implementation of lw_put_cisco_path_mtu
|
|
|
|
*/
|
2018-03-03 17:42:28 +01:00
|
|
|
#include "mbag.h"
|
2015-03-24 20:15:11 +01:00
|
|
|
#include "lwapp_cisco.h"
|
2016-03-04 21:01:38 +01:00
|
|
|
#include "lw.h"
|
2016-03-13 09:40:13 +01:00
|
|
|
#include "vendors.h"
|
2015-03-24 20:15:11 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Put message element data for Cisco vendor specific LWAPP message
|
|
|
|
* Csico Path MTU.
|
|
|
|
* @param dst destination buffer
|
|
|
|
* @param max maximum MTU
|
|
|
|
* @param padding number of bytes to append
|
|
|
|
* @return number of bytes put to buffer
|
|
|
|
*/
|
|
|
|
int lw_put_cisco_path_mtu(uint8_t *dst, uint16_t max, uint16_t padding)
|
|
|
|
{
|
|
|
|
lw_put_dword(dst,LW_VENDOR_ID_CISCO);
|
2015-03-28 11:03:59 +01:00
|
|
|
lw_put_word(dst+4,LW_CISCO_PATH_MTU);
|
2015-03-24 20:15:11 +01:00
|
|
|
lw_put_word(dst+6,max);
|
|
|
|
lw_put_word(dst+8,padding+4);
|
|
|
|
memset(dst+10,0,padding);
|
|
|
|
return padding+10;
|
|
|
|
}
|