代码拉取完成,页面将自动刷新
/*******************************************************************************************
* Copyright (c) 2006-7 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 *
* *
* Author : Ludovico Rossi (ludo@bluepixysw.com) *
* Del Moro Andrea (andrea_delmoro@libero.it) *
* Giovannini Federica (giovannini.federica@gmail.com) *
* Massimo Vellucci (m.vellucci@unicampus.it) *
* Mauro Bisson (mauro.bis@gmail.com) *
*******************************************************************************************/
#include "CWCommon.h"
#ifdef DMALLOC
#include "../dmalloc-5.5.0/dmalloc.h"
#endif
int gCWForceMTU = 0;
int gCWRetransmitTimer = CW_RETRANSMIT_INTERVAL_DEFAULT; //Default value for RetransmitInterval
int gCWNeighborDeadInterval = CW_NEIGHBORDEAD_INTERVAL_DEFAULT; //Default value for NeighbourDeadInterval (no less than 2*EchoInterval and no greater than 240)
int gCWMaxRetransmit = CW_MAX_RETRANSMIT_DEFAULT; //Default value for MaxRetransmit
int CWTimevalSubtract(struct timeval *res, const struct timeval *x, const struct timeval *y)
{
int nsec;
struct timeval z = *y;
// Perform the carry for the later subtraction by updating Y
if (x->tv_usec < z.tv_usec) {
nsec = (z.tv_usec - x->tv_usec) / 1000000 + 1;
z.tv_usec -= 1000000 * nsec;
z.tv_sec += nsec;
}
if (x->tv_usec - z.tv_usec > 1000000) {
nsec = (x->tv_usec - z.tv_usec) / 1000000;
z.tv_usec += 1000000 * nsec;
z.tv_sec -= nsec;
}
// Compute the time remaining to wait. `tv_usec' is certainly positive
if (res != NULL) {
res->tv_sec = x->tv_sec - z.tv_sec;
res->tv_usec = x->tv_usec - z.tv_usec;
}
// Return 1 if result is negative (x < y)
return ((x->tv_sec < z.tv_sec) || ((x->tv_sec == z.tv_sec) && (x->tv_usec < z.tv_usec)));
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。