packet_queue.h

来自「在ns2.28中实现的AODV的升级版本AODV-」· C头文件 代码 · 共 66 行

H
66
字号
/***************************************************************************** * * Copyright (C) 2001 Uppsala University & Ericsson AB. * * 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 * * Authors: Erik Nordstr鰉, <erik.nordstrom@it.uu.se> * *****************************************************************************/#ifndef _PACKET_QUEUE_H#define _PACKET_QUEUE_H#ifndef NS_NO_GLOBALS#define MAX_QUEUE_LENGTH 512#define MAX_QUEUE_TIME 10000 /* Maximum time packets can be queued (ms) */#define GARBAGE_COLLECT_TIME 1000 /* Interval between running the				   * garbage collector (ms) *//* Verdicts for queued packets: */enum {    PQ_DROP = 0,    PQ_SEND = 1,    PQ_ENC_SEND = 2};struct q_pkt {    list_t l;    struct in_addr  dest_addr;    struct timeval q_time;    Packet *p;};struct packet_queue {    list_t head;    unsigned int len;    struct timer garbage_collect_timer;};#endif				/* NS_NO_GLOBALS */#ifndef NS_NO_DECLARATIONSstruct packet_queue PQ;void packet_queue_add(Packet * p, struct in_addr dest_addr);void packet_queue_init();void packet_queue_destroy();int packet_queue_set_verdict(struct in_addr dest_addr, int verdict);int packet_queue_garbage_collect(void);#endif				/* NS_NO_DECLARATIONS */#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?