Skip to content
This repository was archived by the owner on Nov 13, 2023. It is now read-only.

Commit e182924

Browse files
Sumanth SathyanarayanaSumanth Sathyanarayana
authored andcommitted
Merge branch '1.0-MAINT' of git://github.com/OPENNETWORKINGLAB/flowvisor into 1.0-MAINT
2 parents 815abd5 + 3dc23ec commit e182924

31 files changed

+418
-266
lines changed

RELEASE-NOTES

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
FlowVisor 1.0.6 : May 10 2013
2+
* FLOWVISOR-230 : fvctl list-slice-info gives confusing error message if you specify a non-existent slice
3+
* FLOWVISOR-231 : fvctl and network specs
4+
* FLOWVISOR-232 : Error adding flowspace rules with MAC addresses
5+
6+
FlowVisor 1.0.5 : May 2 2013
7+
* FLOWVISOR-216 : Undo changes to default port configurations
8+
* Potential fix for FV crashes; awaiting confirmation
9+
10+
FlowVisor 1.0.4 : May 1 2013
11+
* FLOWVISOR-226 : fvconfig load hangs
12+
13+
FlowVisor 1.0.3 : April 30 2013
14+
* FLOWVISOR-187 : Log level of packets not matching any slice in Flowvisor
15+
* FLOWVISOR-217 : Clients can't detect failures that happen after a request is accepted
16+
17+
FlowVisor 1.0.2 : April 29 2013
18+
* FLOWVISOR-193 : fvctl add-flowspace <match> not working Right
19+
* FLOWVISOR-195 : improve error reporting when FV is not running
20+
* FLOWVISOR-197 : more concise fvctl actions w/default empty password
21+
* FLOWVISOR-201 : Typo in system restart script
22+
* FLOWVISOR-203 : No error message when trying to run FV with another controller already running
23+
* FLOWVISOR-204 : Unfriendly error message when running fvctl to non-running FlowVisor
24+
* FLOWVISOR-207 : different result when running from script vs copying/pasting commands
25+
* FLOWVISOR-216 : Undo changes to default port configurations
26+
127
FlowVisor 1.0.0 : February 28 2013
228
* FLOWVISOR-161 : Make it easy for GENI people to find versions other than the latest
329
* FLOWVISOR-160 : FV does not negotiate an acceptable OpenFlow version if a switch advertises >1.0

scripts/FlowVisorDB.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ AUTOCOMMIT off;
44

55
CREATE TABLE Flowvisor (
66
id INT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
7-
api_webserver_port INT DEFAULT -1 ,
8-
api_jetty_webserver_port INT DEFAULT 8080 ,
7+
api_webserver_port INT DEFAULT 8080 ,
8+
api_jetty_webserver_port INT DEFAULT 8081 ,
99
checkpointing BOOLEAN DEFAULT false,
1010
listen_port INT DEFAULT 6633 ,
1111
track_flows BOOLEAN DEFAULT false ,

scripts/fv-startup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abend ()
5050
case "$1" in
5151
start)
5252
echo Starting flowvisor with the configuration stored in DB >&2
53-
echo "If DB unpopulated, laod config using 'fvconfig load config.json'" >&2
53+
echo "If DB unpopulated, load config using 'fvconfig load config.json'" >&2
5454

5555
sudo -u $FV_USER PREFIX/sbin/flowvisor >> /var/log/flowvisor/flowvisor-stderr.log 2>&1 &
5656
;;

scripts/fvctl.py

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
from optparse import OptionParser
1313

1414
def getPassword(opts):
15+
if opts.no_passwd:
16+
return ""
1517
if opts.fv_passwdfile is None:
1618
passwd = getpass.getpass("Password: ")
1719
else:
@@ -21,10 +23,12 @@ def getPassword(opts):
2123
def addCommonOpts (parser):
2224
parser.add_option("-h", "--hostname", dest="host", default="localhost",
2325
help="Specify the FlowVisor host; default='localhost'")
24-
parser.add_option("-p", "--port", dest="port", default="8080",
25-
help="Specify the FlowVisor web port; default=8080")
26+
parser.add_option("-p", "--port", dest="port", default="8081",
27+
help="Specify the FlowVisor web port; default=8081")
2628
parser.add_option("-u", "--user", dest="fv_user", default="fvadmin",
2729
help="FlowVisor admin user; default='fvadmin'")
30+
parser.add_option("-n", "--no-passwd", action="store_true", dest="no_passwd", default=False,
31+
help="Run fvctl with no password; default false")
2832
parser.add_option("-f", "--passwd-file", dest="fv_passwdfile", default=None,
2933
help="Password file; default=none")
3034
parser.add_option("-v", "--version", action="callback", callback=printVersion)
@@ -241,6 +245,9 @@ def toHex(match):
241245
match[field] = hex(value)
242246
return match
243247

248+
def prettify(fs):
249+
pass
250+
244251

245252
def do_listFlowSpace(gopts, opts, args):
246253
passwd = getPassword(gopts)
@@ -260,6 +267,7 @@ def do_listFlowSpace(gopts, opts, args):
260267
print " None"
261268
sys.exit()
262269
for item in ret:
270+
prettify(item)
263271
if opts.pretty:
264272
print json.dumps(item, sort_keys=True, indent=1)
265273
print "\n\n"
@@ -319,7 +327,7 @@ def do_addFlowSpace(gopts, opts, args):
319327
req['slice-action'] = acts
320328
ret = connect(gopts, "add-flowspace", passwd, data=[req])
321329
if ret:
322-
print "Flowspace %s has been created." % args[0]
330+
print "FlowSpace %s was added with request id %s." % (args[0], ret)
323331

324332
def pa_updateFlowSpace(args, cmd):
325333
usage = "%s [options] <flowspace-name>" % USAGE.format(cmd)
@@ -374,7 +382,7 @@ def do_updateFlowSpace(gopts, opts, args):
374382
sys.exit()
375383
ret = connect(gopts, "update-flowspace", passwd, data=[req])
376384
if ret:
377-
print "Flowspace %s has been updated." % args[0]
385+
print "Flowspace %s was updated with request id %s" % (args[0], ret)
378386

379387
def do_listVersion(gopts, opts, args):
380388
passwd = getPassword(gopts)
@@ -658,6 +666,21 @@ def do_listrewritedb(gopts, opts, args):
658666
for fbe in ret:
659667
print fbe
660668

669+
def pa_listFSStatus(args, cmd):
670+
usage = "%s <fs-id>" % USAGE.format(cmd)
671+
(sdesc, ldesc) = DESCS[cmd]
672+
parser = OptionParser(usage, description=ldesc)
673+
return parser.parse_args(args)
674+
675+
def do_listFSStatus(gopts, opts, args):
676+
if len(args) != 1:
677+
print "list-fs-status : Please specify a flowspace id"
678+
sys.exit()
679+
passwd = getPassword(gopts)
680+
req = { 'fs-id' : int(args[0]) }
681+
ret = connect(gopts, "list-fs-status", passwd, data=req)
682+
print "FlowSpace Request id %s : %s" % (args[0], ret)
683+
661684

662685
def pa_help(args, cmd):
663686
usage = "%s <cmd>" % USAGE.format(cmd)
@@ -714,6 +737,10 @@ def connect(opts, cmd, passwd, data=None):
714737
sys.exit(1)
715738
else:
716739
print e
740+
except urllib2.URLError, e:
741+
print "Could not reach a FlowVisor RPC server at %s:%s." % (opts.host, opts.port)
742+
print "Please check that FlowVisor is running and try again."
743+
sys.exit(1)
717744
except RuntimeError, e:
718745
print e
719746

@@ -731,6 +758,14 @@ def toInt(val):
731758
return int(val,16)
732759
return int(val)
733760

761+
def toMacInt(val):
762+
if val is None:
763+
return
764+
if val.find(":") != -1:
765+
return int(val.replace(':', ''),16)
766+
if val.find("-") != -1:
767+
int(val.replace('-', ''),16)
768+
734769
def toStr(val):
735770
return str(val)
736771

@@ -766,10 +801,10 @@ def print_help(option, opt, value, parser):
766801
MATCHSTRS = {
767802
'in_port' : ('in_port', toInt),
768803
'input_port' : ('in_port', toInt),
769-
'dl_dst' : ('dl_dst', toInt),
770-
'eth_dst' : ('dl_dst', toInt),
771-
'dl_src' : ('dl_src', toInt),
772-
'eth_src' : ('dl_src',toInt),
804+
'dl_dst' : ('dl_dst', toStr),
805+
'eth_dst' : ('dl_dst', toStr),
806+
'dl_src' : ('dl_src', toStr),
807+
'eth_src' : ('dl_src',toStr),
773808
'dl_type' : ('dl_type',toInt),
774809
'eth_type' : ('dl_type',toInt),
775810
'dl_vlan' : ('dl_vlan', toInt),
@@ -799,6 +834,7 @@ def print_help(option, opt, value, parser):
799834
'save-config' : (pa_saveConfig, do_saveConfig),
800835
'get-config' : (pa_getConfig, do_getConfig),
801836
'set-config' : (pa_setConfig, do_setConfig),
837+
'list-fs-status' : (pa_listFSStatus, do_listFSStatus),
802838
'list-slice-info' : (pa_listSliceInfo, do_listSliceInfo),
803839
'list-datapaths' : (pa_none, do_listDatapaths),
804840
'list-datapath-info' : (pa_listDatapathInfo, do_listDatapathInfo),
@@ -822,7 +858,7 @@ def print_help(option, opt, value, parser):
822858
-32603 : "Internal Error"
823859
}
824860

825-
USAGE="%prog {}"
861+
USAGE="%prog {0}"
826862

827863
URL = "https://%s:%s"
828864

@@ -907,6 +943,14 @@ def print_help(option, opt, value, parser):
907943
"global flood permissions. For flowmod limits, the limit is set per slice per dpid. The dpid in "
908944
"case could be 'any'."
909945
)),
946+
'list-fs-status' : ("Check the insertion status of a add-flowspace or update-flowspace request.",
947+
("In some cases, inserting FlowSpace can take a long time. This command allows you to check "
948+
"whether the FlowSpace request has been processed or rejected. Return values are: UNKNOWN, PENDING, "
949+
"SUCCESS, or an error message. PENDING means the request has not been handled yet, UNKNOWN means the "
950+
"given id is not known to the system and SUCCESS means the request was successfully handled. An error "
951+
"is returned when a request fails."
952+
)),
953+
910954
'list-slice-info' : ("Displays slice information",
911955
("Displays slice information about the configured slices at the FlowVisor, "
912956
"including the current message rate and the number of currently installed "

src/org/flowvisor/FlowVisor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class FlowVisor {
4040
public final static int FLOWVISOR_VENDOR_EXTENSION = 0x80000001;
4141

4242
// VERSION
43-
public final static String FLOWVISOR_VERSION = "flowvisor-1.0.0";
43+
public final static String FLOWVISOR_VERSION = "flowvisor-1.0.7";
4444
public final static int FLOWVISOR_DB_VERSION = 2;
4545

4646

@@ -66,7 +66,7 @@ public class FlowVisor {
6666
new Option("l", "logging", "Log to stderr instead of syslog"),
6767
new Option("p", "port", 0, "Override OpenFlow port from config"),
6868
new Option("h", "help", "Print help"),
69-
new Option("j", "JSON web api port",8080, "Override JSON API port from config"),
69+
new Option("j", "JSON web api port",8081, "Override JSON API port from config"),
7070

7171
});
7272

@@ -111,7 +111,7 @@ public int getJettyPort(){
111111
*/
112112
public void setPort(int port) {
113113
try {
114-
FlowvisorImpl.getProxy().setAPIWSPort(port);
114+
FlowvisorImpl.getProxy().setListenPort(port);
115115
} catch (ConfigError e) {
116116
FVLog.log(LogLevel.WARN, null, "Failed to set api port");
117117
}
@@ -149,6 +149,7 @@ public synchronized boolean unregisterHandler(FVEventHandler handler) {
149149
}
150150

151151
public void run() throws ConfigError, IOException, UnhandledEvent {
152+
FVLog.log(LogLevel.DEBUG, null, "HALLO");
152153
FlowVisor.setInstance(this);
153154
Runtime.getRuntime().addShutdownHook(new ShutdownHook());
154155
// init polling loop

src/org/flowvisor/api/JettyServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
public class JettyServer implements Runnable{
3131

32-
public static final int default_jetty_port = 8080;
32+
public static final int default_jetty_port = 8081;
3333

3434
public static String REALM_NAME = "JETTYREALM";
3535
private Server jettyServer;

src/org/flowvisor/api/handlers/ApiHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public interface ApiHandler<T> {
3030
final static String FQUEUE = "force-enqueue";
3131
final static String QUEUE = "queues";
3232
final static String SHOW = "show-disabled";
33+
final static String FSID = "fs-id";
3334

3435

3536
final static String MSG = "msg";

src/org/flowvisor/api/handlers/ConfigurationHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.flowvisor.api.handlers.configuration.AddFlowSpace;
66
import org.flowvisor.api.handlers.configuration.AddSlice;
77
import org.flowvisor.api.handlers.configuration.GetConfig;
8+
import org.flowvisor.api.handlers.configuration.ListFSInsertionStatus;
89
import org.flowvisor.api.handlers.configuration.ListFlowSpace;
910
import org.flowvisor.api.handlers.configuration.ListSlices;
1011
import org.flowvisor.api.handlers.configuration.ListVersion;
@@ -42,6 +43,7 @@ public class ConfigurationHandler implements RequestHandler {
4243
put("save-config", new SaveConfig());
4344
put("get-config", new GetConfig());
4445
put("set-config", new SetConfig());
46+
put("list-fs-status", new ListFSInsertionStatus());
4547
}};
4648

4749

src/org/flowvisor/api/handlers/HandlerUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,17 @@ public static FVMatch matchFromMap(Map<String, Object> map)
8989

9090
String nw_dst = HandlerUtils.<String>fetchField(FVMatch.STR_NW_DST, map, false, null);
9191
if (nw_dst != null) {
92+
match.setWildcards(wildcards);
9293
match.setFromCIDR(nw_dst, FVMatch.STR_NW_DST);
94+
wildcards = match.getWildcards();
9395
map.remove(FVMatch.STR_NW_DST);
9496
}
9597

9698
String nw_src = HandlerUtils.<String>fetchField(FVMatch.STR_NW_SRC, map, false, null);
9799
if (nw_src != null) {
100+
match.setWildcards(wildcards);
98101
match.setFromCIDR(nw_src, FVMatch.STR_NW_SRC);
102+
wildcards = match.getWildcards();
99103
map.remove(FVMatch.STR_NW_SRC);
100104
}
101105

0 commit comments

Comments
 (0)