Debian Codegraph @

protolib/src/common/protoSimAgent.cpp

raw
1 #include "protoSimAgent.h"
2
3 ProtoMessageSink::~ProtoMessageSink()
4 {
5 }
6
7 bool ProtoMessageSink::HandleMessage(const char* txBuffer, unsigned int len,const ProtoAddress& srcAddr)
8 {
9 return true;
10 } // end ProtoMessageSink::HandleMessage()
11
12
13 ProtoSimAgent::ProtoSimAgent()
14 {
15 }
16
17 ProtoSimAgent::~ProtoSimAgent()
18 {
19 }
20
21
22 ProtoSimAgent::SocketProxy::SocketProxy()
23 : proto_socket(NULL)
24 {
25 }
26
27 ProtoSimAgent::SocketProxy::~SocketProxy()
28 {
29 }
30
31 ProtoSimAgent::SocketProxy::List::List()
32 : head(NULL)
33 {
34 }
35
36 void ProtoSimAgent::SocketProxy::List::Prepend(SocketProxy& proxy)
37 {
38 proxy.SetPrev(NULL);
39 proxy.SetNext(head);
40 if (head) head->SetPrev(&proxy);
41 head = &proxy;
42 } // end ProtoSimAgent::SocketProxy::List::Prepend()
43
44 void ProtoSimAgent::SocketProxy::List::Remove(SocketProxy& proxy)
45 {
46 SocketProxy* prev = proxy.GetPrev();
47 SocketProxy* next = proxy.GetNext();
48 if (prev)
49 prev->SetNext(next);
50 else
51 head = next;
52 if (next)
53 next->SetPrev(prev);
54 } // end ProtoSimAgent::SocketProxy::List::Remove()
55
56 ProtoSimAgent::SocketProxy* ProtoSimAgent::SocketProxy::List::FindProxyByPort(UINT16 thePort)
57 {
58 SocketProxy* next = head;
59 while (next)
60 {
61 if (next->GetPort() == thePort)
62 return next;
63 else
64 next = next->GetNext();
65 }
66 return NULL;
67 } // end ProtoSimAgent::SocketProxy::List::FindProxyByPort()
68
69 // I.T. Added 27th Feb 2007
70 ProtoSimAgent::SocketProxy* ProtoSimAgent::SocketProxy::List::FindProxyByIdentifier(int socketProxyID)
71 {
72 SocketProxy* next = head;
73 while (next)
74 {
75 if (next->GetSocketProxyID() == socketProxyID)
76 return next;
77 else
78 next = next->GetNext();
79 }
80 return NULL;
81 } // end OpnetProtoSimProcess::TcpSocketProxy::TcpSockList::FindProxyByIdentifier()