File: semantic-rio.cc

package info (click to toggle)
ns2 2.35%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 78,796 kB
  • sloc: cpp: 172,923; tcl: 107,130; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 816; awk: 525; csh: 355
file content (30 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (8)
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
/* -*-	Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
/*
 * A RIO queue that allows certain operations to be done in a way
 * that depends on higher-layer semantics. The only such operation
 * at present is pickPacketToDrop(), which invokes the corresponding
 * member function in SemanticPacketQueue.
 */

#include "rio.h"
#include "semantic-packetqueue.h"

class SemanticRIOQueue : public RIOQueue {
public:
	SemanticRIOQueue() : RIOQueue() {}
	Packet* pickPacketToDrop() {
		return(((SemanticPacketQueue*) pq_)->pickPacketToDrop());
	}
	Packet* pickPacketForECN(Packet *pkt) {
		return(((SemanticPacketQueue*) pq_)->pickPacketForECN(pkt));
	}
};

static class SemanticRIOClass : public TclClass {
public:
	SemanticRIOClass() : TclClass("Queue/RED/RIO/Semantic") {}
	TclObject* create(int, const char*const*) {
		return (new SemanticRIOQueue);
	}
} class_semantic_rio;