-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyrsvp.cc
More file actions
133 lines (128 loc) · 4.32 KB
/
Myrsvp.cc
File metadata and controls
133 lines (128 loc) · 4.32 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#include "Myrsvp.h"
Define_Module(Myrsvp);
void Myrsvp::Myrsvp_set(RsvpTe *rsvp){
myrsvp = rsvp;
}
int Myrsvp::getInLabel_public(const inet::SessionObj& session, const inet::SenderTemplateObj& sender)
{
return RsvpTe::getInLabel(session, sender);
}
void Myrsvp::insert_session(){
// traffic_session_t newSession;
//
// newSession.sobj.Tunnel_Id = tunnel_id;
// newSession.sobj.Extended_Tunnel_Id = routerId.getInt();
// newSession.sobj.DestAddress = destAddr;//getParameterIPAddressValue(session, "endpoint");
//
// auto sit = findSession(newSession.sobj);
//
// bool merge;
//
// if (sit != traffic.end()) {
// // session already exits, add new paths
//
// merge = true;
//
// newSession.sobj.setupPri = sit->sobj.setupPri;
// newSession.sobj.holdingPri = sit->sobj.holdingPri;
//
// sit->sobj = newSession.sobj;
// }
// else {
// // session not found, create new
//
// merge = false;
//
// newSession.sobj.setupPri = 7;//getParameterIntValue(session, "setup_pri", 7);
// newSession.sobj.holdingPri = 7;//getParameterIntValue(session, "holding_pri", 7);
// }
//
// const cXMLElement *paths = getUniqueChild(session, "paths");
// checkTags(paths, "path");
//
// cXMLElementList list = paths->getChildrenByTagName("path");
// for (auto path : list) {
// checkTags(path, "sender lspid bandwidth max_delay route permanent owner color");
//
// int lspid = lspid;//getParameterIntValue(path, "lspid");
// ;
//
// std::vector<traffic_path_t>::iterator pit;
//
// traffic_path_t newPath;
//
// newPath.sender.SrcAddress = getParameterIPAddressValue(path, "sender", routerId);
// newPath.sender.Lsp_Id = lspid;
//
// // make sure path doesn't exist yet
//
// if (merge) {
// pit = findPath(&(*sit), newPath.sender);
// if (pit != sit->paths.end()) {
// EV_DETAIL << "path " << lspid << " already exists in this session, doing nothing" << endl;
// continue;
// }
// }
// else {
// pit = findPath(&newSession, newPath.sender);
// if (pit != newSession.paths.end()) {
// EV_INFO << "path " << lspid << " already exists in this session, doing nothing" << endl;
// continue;
// }
// }
//
// const char *str = getParameterStrValue(path, "owner", "");
// if (strlen(str)) {
// cModule *mod = getModuleByPath(str);
// newPath.owner = mod->getId();
// }
// else {
// newPath.owner = getId();
// }
//
// newPath.permanent = getParameterBoolValue(path, "permanent", true);
// newPath.color = getParameterIntValue(path, "color", 0);
//
// newPath.tspec.req_bandwidth = getParameterDoubleValue(path, "bandwidth", 0.0);
// newPath.max_delay = getParameterDoubleValue(path, "max_delay", 0.0);
//
// const cXMLElement *route = getUniqueChildIfExists(path, "route");
// if (route)
// newPath.ERO = readTrafficRouteFromXML(route);
//
// if (merge) {
// EV_INFO << "adding new path into an existing session" << endl;
//
// sit->paths.push_back(newPath);
// }
// else {
// EV_INFO << "adding new path into new session" << endl;
//
// newSession.paths.push_back(newPath);
// }
//
// // schedule path creation
//
// sendPathNotify(getId(), newSession.sobj, newPath.sender, inet::PATH_RETRY, 0.0);
// }
//
// if (!merge) {
// EV_INFO << "adding new session into database" << endl;
//
// traffic.push_back(newSession);
// }
}