示例#1
0
 @Override
 public boolean setMaximumFlowMods(String sliceName, String dpid, String maxFlowMods)
     throws PermissionDeniedException {
   String user = APIUserCred.getUserName();
   if (!APIAuth.transitivelyCreated(user, sliceName) && !FVConfig.isSupervisor(user))
     throw new PermissionDeniedException(
         "User " + user + " does not have perms to set the flow mod limit for slice " + sliceName);
   Long dp = FlowSpaceUtil.parseDPID(dpid);
   int limit = Integer.parseInt(maxFlowMods);
   FVLog.log(
       LogLevel.DEBUG,
       null,
       "Setting flowmod limit for slice "
           + sliceName
           + " for dpid "
           + dpid
           + " to "
           + maxFlowMods);
   try {
     if (dp == FlowEntry.ALL_DPIDS) SliceImpl.getProxy().setMaxFlowMods(sliceName, limit);
     else SwitchImpl.getProxy().setMaxFlowMods(sliceName, dp, limit);
   } catch (ConfigError e) {
     return false;
   }
   return true;
 }
示例#2
0
  public void init() {
    FVLog.log(LogLevel.DEBUG, this, "initializing new FVSlicer");

    // snag controller info from config
    try {
      hostname = FVConfig.getSliceHost(sliceName);
      port = FVConfig.getSlicePort(sliceName);
      lldpOptIn = FVConfig.getLLDPSpam(sliceName);
      SliceImpl.addListener(sliceName, this);
    } catch (ConfigError e) {
      FVLog.log(
          LogLevel.CRIT, this, "ignoring slice ", sliceName, " malformed slice definition: ", e);
      this.tearDown();
      return;
    }
    this.updatePortList();
    this.reconnect();
    this.keepAlive = new OFKeepAlive(this, this, loop);
    this.keepAlive.scheduleNextCheck();
    fvClassifier.loadLimit(sliceName);
    fvClassifier.loadRateLimit(sliceName);
    try {
      this.fmlimit = SliceImpl.getProxy().getMaxFlowMods(sliceName);
    } catch (ConfigError e) {
      FVLog.log(LogLevel.WARN, this, "Global slice flow mod limit unreadable; disabling.");
      this.fmlimit = -1;
    }
  }
示例#3
0
 @Override
 public Integer getMaximumFlowMods(String sliceName, String dpid)
     throws PermissionDeniedException {
   String user = APIUserCred.getUserName();
   if (!APIAuth.transitivelyCreated(user, sliceName) && !FVConfig.isSupervisor(user))
     throw new PermissionDeniedException(
         "User " + user + " does not have perms to get the flow mod limit for slice " + sliceName);
   Long dp = FlowSpaceUtil.parseDPID(dpid);
   try {
     if (dp == FlowEntry.ALL_DPIDS) return SliceImpl.getProxy().getMaxFlowMods(sliceName);
     else return SwitchImpl.getProxy().getMaxFlowMods(sliceName, dp);
   } catch (ConfigError e) {
     FVLog.log(LogLevel.DEBUG, null, "Unable to get flow mod limit; " + e.getMessage());
     return null;
   }
 }
示例#4
0
 public boolean isUp() {
   return SliceImpl.getProxy().isSliceUp(this.sliceName);
 }