import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.genius.utils.batching.DefaultBatchHandler;
import org.opendaylight.genius.utils.clustering.EntityOwnerUtils;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.AddressFamiliesReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.AsIdReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.BgpReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.ConfigServerReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.EbgpMultihopReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.GracefulRestartReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.LoggingReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.MultipathReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.NeighborsReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.NetworksReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.RouteCleanup;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.UpdateSourceReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.VrfMaxpathReactor;
-import org.opendaylight.netvirt.bgpmanager.BgpConfigurationManager.VrfsReactor;
import org.opendaylight.netvirt.bgpmanager.api.IBgpManager;
import org.opendaylight.netvirt.bgpmanager.commands.ClearBgpCli;
import org.opendaylight.netvirt.bgpmanager.oam.BgpAlarms;
String macaddress = val.getMacaddress();
EncapType encapType = val.getEncapType();
String routerMac = val.getRoutermac();
+ int afiInt = testValueAFI(pfxlen);
try {
br.addPrefix(rd, pfxlen, nh, lbl, l3vni, BgpUtil.convertToThriftProtocolType(protocolType),
- ethernetTag, esi, macaddress, BgpUtil.convertToThriftEncapType(encapType), routerMac);
+ ethernetTag, esi, macaddress, BgpUtil.convertToThriftEncapType(encapType),
+ routerMac);
} catch (TException | BgpRouterException e) {
LOG.error("{} Add received exception; {}", YANG_OBJ, ADD_WARN, e);
}
}
Long label = val.getLabel();
int lbl = (label == null) ? 0 : label.intValue();
+ int afiInt = testValueAFI(pfxlen);
if (rd == null && lbl > 0) {
//LU prefix is being deleted.
rd = Integer.toString(lbl);
}
}
+ /**get the value AFI from a prefix as "x.x.x.x/x".
+ *
+ * @param pfxlen the prefix to get an afi
+ * @return the afi value as you are need
+ */
+ public int testValueAFI(String pfxlen) {
+ int afiNew = af_afi.AFI_IP.getValue();
+ try {
+ String ipOnly = pfxlen.substring(0, pfxlen.lastIndexOf("/"));
+ java.net.Inet6Address.getByName(ipOnly);
+ afiNew = af_afi.AFI_IPV6.getValue();
+ } catch (java.net.UnknownHostException e) {
+ //ce n'est pas de l'ipv6
+ }
+ return afiNew;
+ }
+
+
@Override
protected void update(final InstanceIdentifier<Networks> iid,
final Networks oldval, final Networks newval) {
return;
}
while (bsh.getState() != bsh.DONE) {
- Routes routes = null;
- try {
- routes = bgpRouter.doRibSync(bsh);
- } catch (TException | BgpRouterException e) {
- LOG.error("Route sync aborted, exception when syncing", e);
- return;
- }
- Iterator<Update> updates = routes.getUpdatesIterator();
- while (updates.hasNext()) {
- Update update = updates.next();
- Map<String, Map<String, Long>> staleFibRdMap = BgpConfigurationManager.getStaledFibEntriesMap();
- String rd = update.getRd();
- String nexthop = update.getNexthop();
+ for (af_afi afi : af_afi.values()) {
+ Routes routes = null;
+ try {
+ routes = bgpRouter.doRibSync(bsh, afi);
+ } catch (TException | BgpRouterException e) {
+ LOG.error("Route sync aborted, exception when syncing", e);
+ return;
+ }
+ Iterator<Update> updates = routes.getUpdatesIterator();
+ while (updates.hasNext()) {
+ Update update = updates.next();
+ Map<String, Map<String, Long>> staleFibRdMap = BgpConfigurationManager.getStaledFibEntriesMap();
+ String rd = update.getRd();
+ String nexthop = update.getNexthop();
- // TODO: decide correct label here
- int label = update.getL3label();
+ // TODO: decide correct label here
+ int label = update.getL3label();
- String prefix = update.getPrefix();
- int plen = update.getPrefixlen();
+ String prefix = update.getPrefix();
+ int plen = update.getPrefixlen();
- // TODO: protocol type will not be available in "update"
- // use "rd" to query vrf table and obtain the protocol_type. Currently using PROTOCOL_EVPN as default.
- onUpdatePushRoute(
- protocol_type.PROTOCOL_EVPN,
- rd,
- prefix,
- plen,
- nexthop,
- update.getEthtag(),
- update.getEsi(),
- update.getMacaddress(),
- label,
- update.getRoutermac()
- );
+ // TODO: protocol type will not be available in "update"
+ // use "rd" to query vrf table and obtain the protocol_type.
+ // Currently using PROTOCOL_EVPN as default.
+ onUpdatePushRoute(
+ protocol_type.PROTOCOL_EVPN,
+ rd,
+ prefix,
+ plen,
+ nexthop,
+ update.getEthtag(),
+ update.getEsi(),
+ update.getMacaddress(),
+ label,
+ update.getRoutermac(),
+ afi
+ );
+ }
}
}
try {
String esi,
String macaddress,
int label,
- String routermac)
+ String routermac,
+ af_afi afi)
throws InterruptedException, ExecutionException, TimeoutException {
boolean addroute = false;
long l3vni = 0L;
addroute = true;
}
if (addroute) {
- LOG.info("ADD: Adding Fib entry rd {} prefix {} nexthop {} label {}", rd, prefix, nextHop, label);
+ LOG.info("ADD: Adding Fib entry rd {} prefix {} nexthop {} label {} afi {}",
+ rd, prefix, nextHop, label, afi);
// TODO: modify addFibEntryToDS signature
List<String> nextHopList = Collections.singletonList(nextHop);
fibDSWriter.addFibEntryToDS(rd, macaddress, prefix + "/" + plen, nextHopList, encapType, label, l3vni,
Long label = net.getLabel();
int lbl = (label == null) ? 0 : label.intValue();
int l3vni = (net.getL3vni() == null) ? 0 : net.getL3vni().intValue();
+ Long afi = net.getAfi();
+ int afint = (afi == null) ? (int) af_afi.AFI_IP.getValue() : afi.intValue();
if (rd == null && lbl > 0) {
//LU prefix is being deleted.
rd = Integer.toString(lbl);
try {
br.addPrefix(rd, pfxlen, nh, lbl, l3vni, BgpUtil.convertToThriftProtocolType(protocolType),
- ethernetTag, esi, macaddress, BgpUtil.convertToThriftEncapType(encapType), routerMac);
+ ethernetTag, esi, macaddress, BgpUtil.convertToThriftEncapType(encapType),
+ routerMac);
} catch (Exception e) {
LOG.error("Replay:addPfx() received exception", e);
}
}
public void addPrefix(String rd, String macAddress, String pfx, List<String> nhList,
- VrfEntry.EncapType encapType, long lbl, long l3vni, long l2vni, String gatewayMac, int addressFamily) {
+ VrfEntry.EncapType encapType, long lbl, long l3vni, long l2vni, String gatewayMac) {
for (String nh : nhList) {
Ipv4Address nexthop = nh != null ? new Ipv4Address(nh) : null;
Long label = lbl;
- Long afi = (long) addressFamily;
InstanceIdentifier<Networks> iid = InstanceIdentifier.builder(Bgp.class)
.child(Networks.class, new NetworksKey(pfx, rd)).build();
NetworksBuilder networksBuilder = new NetworksBuilder().setRd(rd).setPrefixLen(pfx).setNexthop(nexthop)
- .setLabel(label).setEthtag(BgpConstants.DEFAULT_ETH_TAG)
- .setAfi(afi);
+ .setLabel(label).setEthtag(BgpConstants.DEFAULT_ETH_TAG);
buildVpnEncapSpecificInfo(networksBuilder, encapType, label, l3vni, l2vni, macAddress, gatewayMac);
update(iid, networksBuilder.build());
}
delete(iid);
}
- public void delPrefix(String rd, String pfx, int afi) {
+ public void delPrefix(String rd, String pfx) {
InstanceIdentifier.InstanceIdentifierBuilder<Networks> iib =
InstanceIdentifier.builder(Bgp.class)
.child(Networks.class, new NetworksKey(pfx, rd));
fibDSWriter.addFibEntryToDS(rd, macAddress, prefix, nextHopList,
encapType, vpnLabel, l3vni, gatewayMac, origin);
bcm.addPrefix(rd, macAddress, prefix, nextHopList,
- encapType, vpnLabel, l3vni, 0 /*l2vni*/, gatewayMac, 1 /* TODO FIX afi */);
+ encapType, vpnLabel, l3vni, 0 /*l2vni*/, gatewayMac);
}
@Override
@Override
public void deletePrefix(String rd, String prefix) {
fibDSWriter.removeFibEntryFromDS(rd, prefix);
- bcm.delPrefix(rd, prefix, 1 /* TODO FIX afi */);
+ bcm.delPrefix(rd, prefix);
}
@Override
VrfEntry.EncapType encapType, long vpnLabel, long l3vni, long l2vni,
String gatewayMac) throws Exception {
bcm.addPrefix(rd, macAddress, prefix, nextHopList,
- encapType, vpnLabel, l3vni, l2vni, gatewayMac, 1 /* TODO FIX afi */);
+ encapType, vpnLabel, l3vni, l2vni, gatewayMac);
}
@Override
public void advertisePrefix(String rd, String macAddress, String prefix, String nextHop,
VrfEntry.EncapType encapType, long vpnLabel, long l3vni, long l2vni,
String gatewayMac) throws Exception {
- LOG.info("ADVERTISE: Adding Prefix rd {} prefix {} nexthop {} label {}", rd, prefix, nextHop, vpnLabel);
+ LOG.info("ADVERTISE: Adding Prefix rd {} prefix {} nexthop {} label {} afi {}",
+ rd, prefix, nextHop, vpnLabel);
bcm.addPrefix(rd, macAddress, prefix, Collections.singletonList(nextHop), encapType,
- vpnLabel, l3vni, l2vni, gatewayMac, 1 /* TODO FIX afi */);
- LOG.info("ADVERTISE: Added Prefix rd {} prefix {} nexthop {} label {}", rd, prefix, nextHop, vpnLabel);
+ vpnLabel, l3vni, l2vni, gatewayMac);
+ LOG.info("ADVERTISE: Added Prefix rd {} prefix {} nexthop {} label {} afi {}",
+ rd, prefix, nextHop, vpnLabel);
}
@Override
public void withdrawPrefix(String rd, String prefix) {
- LOG.info("WITHDRAW: Removing Prefix rd {} prefix {}", rd, prefix);
- bcm.delPrefix(rd, prefix, 1 /* TODO FIX afi */);
- LOG.info("WITHDRAW: Removed Prefix rd {} prefix {}", rd, prefix);
+ LOG.info("WITHDRAW: Removing Prefix rd {} prefix {} afi {}", rd, prefix);
+ bcm.delPrefix(rd, prefix);
+ LOG.info("WITHDRAW: Removed Prefix rd {} prefix {} afi {}", rd, prefix);
}
public void setQbgpLog(String fileName, String debugLevel) {
private static BlockingQueue<ActionableResource> bgpResourcesBufferQ = new LinkedBlockingQueue<>();
+ /** get a translation from prefix ipv6 to afi<br>.
+ * "ffff::1/128" sets afi as 2 because is an IPv6 value
+ * @param argPrefix ip address as ipv4 or ipv6
+ * @return afi 1 for ipv4 2 for ipv2
+ */
+ public static int getAFItranslatedfromPrefix(String argPrefix) {
+ int retValue = 1;//default afiValue is 1 (= ipv4)
+ try {
+ if (argPrefix == null) {
+ return retValue;
+ }
+ String ipValue = argPrefix;
+ if (argPrefix.lastIndexOf("/") > 0) { /*then the prefix includes mask definition*/
+ ipValue = argPrefix.substring(0, argPrefix.lastIndexOf("/"));
+ }
+ java.net.Inet6Address.getByName(ipValue);
+ } catch (java.net.UnknownHostException e) {
+ /*if exception is catched then the prefix is not an IPv6*/
+ retValue = 1;//default afiValue is 1 (= ipv4)
+ }
+ return retValue;
+ }
+
// return number of pending Write Transactions with BGP-Util (no read)
public static int getGetPendingWrTransaction() {
return pendingWrTransaction.get();
public int l3label;
public encap_type thriftEncapType;
public String routermac;
+ public af_afi afi;
BgpOp() {
strs = new String[3];
case PFX:
// order of args is different in addPrefix(), hence the
// seeming out-of-order-ness of string indices
+ afi = af_afi.findByValue(org.opendaylight.netvirt.bgpmanager.BgpUtil
+ .getAFItranslatedfromPrefix(op.strs[1]));
result = bop.add
? bgpClient.pushRoute(
op.thriftProtocolType,
op.l3label,
op.l2label,
op.thriftEncapType,
- op.routermac)
+ op.routermac,
+ op.afi)
: bgpClient.withdrawRoute(
op.thriftProtocolType,
op.strs[0],//rd
op.ethernetTag,
op.esi,
- op.macAddress);
+ op.macAddress,
+ op.afi);
break;
case LOG:
result = bgpClient.setLogConfig(op.strs[0], op.strs[1]);
return 0;
}
- public Routes doRibSync(BgpSyncHandle handle) throws TException, BgpRouterException {
+ public Routes doRibSync(BgpSyncHandle handle, af_afi afi) throws TException, BgpRouterException {
if (bgpClient == null) {
throw new BgpRouterException(BgpRouterException.BGP_ERR_NOT_INITED);
}
handle.setState(BgpSyncHandle.ITERATING);
int winSize = handle.getMaxCount() * handle.getRouteSize();
+
// TODO: receive correct protocol_type here, currently populating with dummy protocol type
- Routes outRoutes = bgpClient.getRoutes(protocol_type.PROTOCOL_ANY, op, winSize);
+ Routes outRoutes = bgpClient.getRoutes(protocol_type.PROTOCOL_ANY, op, winSize, afi);
if (outRoutes.errcode != 0) {
return outRoutes;
}
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
public int delVrf(String rd) throws org.apache.thrift.TException;
- public int pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac) throws org.apache.thrift.TException;
+ public int pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac, af_afi afi) throws org.apache.thrift.TException;
- public int withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress) throws org.apache.thrift.TException;
+ public int withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress, af_afi afi) throws org.apache.thrift.TException;
public int setEbgpMultihop(String peerIp, int nHops) throws org.apache.thrift.TException;
public int disableGracefulRestart() throws org.apache.thrift.TException;
- public Routes getRoutes(protocol_type p_type, int optype, int winSize) throws org.apache.thrift.TException;
+ public Routes getRoutes(protocol_type p_type, int optype, int winSize, af_afi afi) throws org.apache.thrift.TException;
public int enableMultipath(af_afi afi, af_safi safi) throws org.apache.thrift.TException;
public void delVrf(String rd, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void setEbgpMultihop(String peerIp, int nHops, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void disableGracefulRestart(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void getRoutes(protocol_type p_type, int optype, int winSize, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void getRoutes(protocol_type p_type, int optype, int winSize, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void enableMultipath(af_afi afi, af_safi safi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "delVrf failed: unknown result");
}
- public int pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac) throws org.apache.thrift.TException
+ public int pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac, af_afi afi) throws org.apache.thrift.TException
{
- send_pushRoute(p_type, prefix, nexthop, rd, ethtag, esi, macaddress, l3label, l2label, enc_type, routermac);
+ send_pushRoute(p_type, prefix, nexthop, rd, ethtag, esi, macaddress, l3label, l2label, enc_type, routermac, afi);
return recv_pushRoute();
}
- public void send_pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac) throws org.apache.thrift.TException
+ public void send_pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac, af_afi afi) throws org.apache.thrift.TException
{
pushRoute_args args = new pushRoute_args();
args.setP_type(p_type);
args.setL2label(l2label);
args.setEnc_type(enc_type);
args.setRoutermac(routermac);
+ args.setAfi(afi);
sendBase("pushRoute", args);
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "pushRoute failed: unknown result");
}
- public int withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress) throws org.apache.thrift.TException
+ public int withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress, af_afi afi) throws org.apache.thrift.TException
{
- send_withdrawRoute(p_type, prefix, rd, ethtag, esi, macaddress);
+ send_withdrawRoute(p_type, prefix, rd, ethtag, esi, macaddress, afi);
return recv_withdrawRoute();
}
- public void send_withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress) throws org.apache.thrift.TException
+ public void send_withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress, af_afi afi) throws org.apache.thrift.TException
{
withdrawRoute_args args = new withdrawRoute_args();
args.setP_type(p_type);
args.setEthtag(ethtag);
args.setEsi(esi);
args.setMacaddress(macaddress);
+ args.setAfi(afi);
sendBase("withdrawRoute", args);
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "disableGracefulRestart failed: unknown result");
}
- public Routes getRoutes(protocol_type p_type, int optype, int winSize) throws org.apache.thrift.TException
+ public Routes getRoutes(protocol_type p_type, int optype, int winSize, af_afi afi) throws org.apache.thrift.TException
{
- send_getRoutes(p_type, optype, winSize);
+ send_getRoutes(p_type, optype, winSize, afi);
return recv_getRoutes();
}
- public void send_getRoutes(protocol_type p_type, int optype, int winSize) throws org.apache.thrift.TException
+ public void send_getRoutes(protocol_type p_type, int optype, int winSize, af_afi afi) throws org.apache.thrift.TException
{
getRoutes_args args = new getRoutes_args();
args.setP_type(p_type);
args.setOptype(optype);
args.setWinSize(winSize);
+ args.setAfi(afi);
sendBase("getRoutes", args);
}
}
}
- public void pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void pushRoute(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- pushRoute_call method_call = new pushRoute_call(p_type, prefix, nexthop, rd, ethtag, esi, macaddress, l3label, l2label, enc_type, routermac, resultHandler, this, ___protocolFactory, ___transport);
+ pushRoute_call method_call = new pushRoute_call(p_type, prefix, nexthop, rd, ethtag, esi, macaddress, l3label, l2label, enc_type, routermac, afi, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
private int l2label;
private encap_type enc_type;
private String routermac;
- public pushRoute_call(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private af_afi afi;
+ public pushRoute_call(protocol_type p_type, String prefix, String nexthop, String rd, int ethtag, String esi, String macaddress, int l3label, int l2label, encap_type enc_type, String routermac, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.p_type = p_type;
this.prefix = prefix;
this.l2label = l2label;
this.enc_type = enc_type;
this.routermac = routermac;
+ this.afi = afi;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
args.setL2label(l2label);
args.setEnc_type(enc_type);
args.setRoutermac(routermac);
+ args.setAfi(afi);
args.write(prot);
prot.writeMessageEnd();
}
}
}
- public void withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void withdrawRoute(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- withdrawRoute_call method_call = new withdrawRoute_call(p_type, prefix, rd, ethtag, esi, macaddress, resultHandler, this, ___protocolFactory, ___transport);
+ withdrawRoute_call method_call = new withdrawRoute_call(p_type, prefix, rd, ethtag, esi, macaddress, afi, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
private int ethtag;
private String esi;
private String macaddress;
- public withdrawRoute_call(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private af_afi afi;
+ public withdrawRoute_call(protocol_type p_type, String prefix, String rd, int ethtag, String esi, String macaddress, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.p_type = p_type;
this.prefix = prefix;
this.ethtag = ethtag;
this.esi = esi;
this.macaddress = macaddress;
+ this.afi = afi;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
args.setEthtag(ethtag);
args.setEsi(esi);
args.setMacaddress(macaddress);
+ args.setAfi(afi);
args.write(prot);
prot.writeMessageEnd();
}
}
}
- public void getRoutes(protocol_type p_type, int optype, int winSize, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void getRoutes(protocol_type p_type, int optype, int winSize, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- getRoutes_call method_call = new getRoutes_call(p_type, optype, winSize, resultHandler, this, ___protocolFactory, ___transport);
+ getRoutes_call method_call = new getRoutes_call(p_type, optype, winSize, afi, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
private protocol_type p_type;
private int optype;
private int winSize;
- public getRoutes_call(protocol_type p_type, int optype, int winSize, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private af_afi afi;
+ public getRoutes_call(protocol_type p_type, int optype, int winSize, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.p_type = p_type;
this.optype = optype;
this.winSize = winSize;
+ this.afi = afi;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
args.setP_type(p_type);
args.setOptype(optype);
args.setWinSize(winSize);
+ args.setAfi(afi);
args.write(prot);
prot.writeMessageEnd();
}
public pushRoute_result getResult(I iface, pushRoute_args args) throws org.apache.thrift.TException {
pushRoute_result result = new pushRoute_result();
- result.success = iface.pushRoute(args.p_type, args.prefix, args.nexthop, args.rd, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.enc_type, args.routermac);
+ result.success = iface.pushRoute(args.p_type, args.prefix, args.nexthop, args.rd, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.enc_type, args.routermac, args.afi);
result.setSuccessIsSet(true);
return result;
}
public withdrawRoute_result getResult(I iface, withdrawRoute_args args) throws org.apache.thrift.TException {
withdrawRoute_result result = new withdrawRoute_result();
- result.success = iface.withdrawRoute(args.p_type, args.prefix, args.rd, args.ethtag, args.esi, args.macaddress);
+ result.success = iface.withdrawRoute(args.p_type, args.prefix, args.rd, args.ethtag, args.esi, args.macaddress, args.afi);
result.setSuccessIsSet(true);
return result;
}
public getRoutes_result getResult(I iface, getRoutes_args args) throws org.apache.thrift.TException {
getRoutes_result result = new getRoutes_result();
- result.success = iface.getRoutes(args.p_type, args.optype, args.winSize);
+ result.success = iface.getRoutes(args.p_type, args.optype, args.winSize, args.afi);
return result;
}
}
public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Integer>() {
+ return new AsyncMethodCallback<Integer>() {
public void onComplete(Integer o) {
startBgp_result result = new startBgp_result();
result.success = o;
public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Integer>() {
+ return new AsyncMethodCallback<Integer>() {
public void onComplete(Integer o) {
setPeerSecret_result result = new setPeerSecret_result();
result.success = o;
}
public void start(I iface, pushRoute_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException {
- iface.pushRoute(args.p_type, args.prefix, args.nexthop, args.rd, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.enc_type, args.routermac,resultHandler);
+ iface.pushRoute(args.p_type, args.prefix, args.nexthop, args.rd, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.enc_type, args.routermac, args.afi,resultHandler);
}
}
}
public void start(I iface, withdrawRoute_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException {
- iface.withdrawRoute(args.p_type, args.prefix, args.rd, args.ethtag, args.esi, args.macaddress,resultHandler);
+ iface.withdrawRoute(args.p_type, args.prefix, args.rd, args.ethtag, args.esi, args.macaddress, args.afi,resultHandler);
}
}
}
public void start(I iface, getRoutes_args args, org.apache.thrift.async.AsyncMethodCallback<Routes> resultHandler) throws TException {
- iface.getRoutes(args.p_type, args.optype, args.winSize,resultHandler);
+ iface.getRoutes(args.p_type, args.optype, args.winSize, args.afi,resultHandler);
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.IP_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("ipAddress", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.IP_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("ipAddress", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.RFC2385_SHARED_SECRET, new org.apache.thrift.meta_data.FieldMetaData("rfc2385_sharedSecret", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.RFC2385_SHARED_SECRET, new org.apache.thrift.meta_data.FieldMetaData("rfc2385_sharedSecret", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setPeerSecret_args.class, metaDataMap);
while (true)
{
schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.ipAddress = iprot.readString();
struct.setIpAddressIsSet(true);
- } else {
+ } else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.rfc2385_sharedSecret = iprot.readString();
struct.setRfc2385_sharedSecretIsSet(true);
- } else {
+ } else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setPeerSecret_result.class, metaDataMap);
while (true)
{
schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.success = iprot.readI32();
struct.setSuccessIsSet(true);
- } else {
+ } else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
private static final org.apache.thrift.protocol.TField L2LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("l2label", org.apache.thrift.protocol.TType.I32, (short)9);
private static final org.apache.thrift.protocol.TField ENC_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("enc_type", org.apache.thrift.protocol.TType.I32, (short)10);
private static final org.apache.thrift.protocol.TField ROUTERMAC_FIELD_DESC = new org.apache.thrift.protocol.TField("routermac", org.apache.thrift.protocol.TType.STRING, (short)11);
+ private static final org.apache.thrift.protocol.TField AFI_FIELD_DESC = new org.apache.thrift.protocol.TField("afi", org.apache.thrift.protocol.TType.I32, (short)12);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
*/
public encap_type enc_type; // required
public String routermac; // required
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi afi; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
* @see encap_type
*/
ENC_TYPE((short)10, "enc_type"),
- ROUTERMAC((short)11, "routermac");
+ ROUTERMAC((short)11, "routermac"),
+ /**
+ *
+ * @see af_afi
+ */
+ AFI((short)12, "afi");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
return ENC_TYPE;
case 11: // ROUTERMAC
return ROUTERMAC;
+ case 12: // AFI
+ return AFI;
default:
return null;
}
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, encap_type.class)));
tmpMap.put(_Fields.ROUTERMAC, new org.apache.thrift.meta_data.FieldMetaData("routermac", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.AFI, new org.apache.thrift.meta_data.FieldMetaData("afi", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, af_afi.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pushRoute_args.class, metaDataMap);
}
int l3label,
int l2label,
encap_type enc_type,
- String routermac)
+ String routermac,
+ af_afi afi)
{
this();
this.p_type = p_type;
setL2labelIsSet(true);
this.enc_type = enc_type;
this.routermac = routermac;
+ this.afi = afi;
}
/**
if (other.isSetRoutermac()) {
this.routermac = other.routermac;
}
+ if (other.isSetAfi()) {
+ this.afi = other.afi;
+ }
}
public pushRoute_args deepCopy() {
this.l2label = 0;
this.enc_type = null;
this.routermac = null;
+ this.afi = null;
}
/**
}
}
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi getAfi() {
+ return this.afi;
+ }
+
+ /**
+ *
+ * @see af_afi
+ */
+ public pushRoute_args setAfi(af_afi afi) {
+ this.afi = afi;
+ return this;
+ }
+
+ public void unsetAfi() {
+ this.afi = null;
+ }
+
+ /** Returns true if field afi is set (has been assigned a value) and false otherwise */
+ public boolean isSetAfi() {
+ return this.afi != null;
+ }
+
+ public void setAfiIsSet(boolean value) {
+ if (!value) {
+ this.afi = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case P_TYPE:
}
break;
+ case AFI:
+ if (value == null) {
+ unsetAfi();
+ } else {
+ setAfi((af_afi)value);
+ }
+ break;
+
}
}
case ROUTERMAC:
return getRoutermac();
+ case AFI:
+ return getAfi();
+
}
throw new IllegalStateException();
}
return isSetEnc_type();
case ROUTERMAC:
return isSetRoutermac();
+ case AFI:
+ return isSetAfi();
}
throw new IllegalStateException();
}
return false;
}
+ boolean this_present_afi = true && this.isSetAfi();
+ boolean that_present_afi = true && that.isSetAfi();
+ if (this_present_afi || that_present_afi) {
+ if (!(this_present_afi && that_present_afi))
+ return false;
+ if (!this.afi.equals(that.afi))
+ return false;
+ }
+
return true;
}
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetAfi()).compareTo(other.isSetAfi());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAfi()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.afi, other.afi);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
sb.append(this.routermac);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("afi:");
+ if (this.afi == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.afi);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 12: // AFI
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
oprot.writeString(struct.routermac);
oprot.writeFieldEnd();
}
+ if (struct.afi != null) {
+ oprot.writeFieldBegin(AFI_FIELD_DESC);
+ oprot.writeI32(struct.afi.getValue());
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
if (struct.isSetRoutermac()) {
optionals.set(10);
}
- oprot.writeBitSet(optionals, 11);
+ if (struct.isSetAfi()) {
+ optionals.set(11);
+ }
+ oprot.writeBitSet(optionals, 12);
if (struct.isSetP_type()) {
oprot.writeI32(struct.p_type.getValue());
}
if (struct.isSetRoutermac()) {
oprot.writeString(struct.routermac);
}
+ if (struct.isSetAfi()) {
+ oprot.writeI32(struct.afi.getValue());
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, pushRoute_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(11);
+ BitSet incoming = iprot.readBitSet(12);
if (incoming.get(0)) {
struct.p_type = protocol_type.findByValue(iprot.readI32());
struct.setP_typeIsSet(true);
struct.routermac = iprot.readString();
struct.setRoutermacIsSet(true);
}
+ if (incoming.get(11)) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ }
}
}
private static final org.apache.thrift.protocol.TField ETHTAG_FIELD_DESC = new org.apache.thrift.protocol.TField("ethtag", org.apache.thrift.protocol.TType.I32, (short)4);
private static final org.apache.thrift.protocol.TField ESI_FIELD_DESC = new org.apache.thrift.protocol.TField("esi", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.protocol.TField MACADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("macaddress", org.apache.thrift.protocol.TType.STRING, (short)6);
+ private static final org.apache.thrift.protocol.TField AFI_FIELD_DESC = new org.apache.thrift.protocol.TField("afi", org.apache.thrift.protocol.TType.I32, (short)7);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
public int ethtag; // required
public String esi; // required
public String macaddress; // required
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi afi; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
RD((short)3, "rd"),
ETHTAG((short)4, "ethtag"),
ESI((short)5, "esi"),
- MACADDRESS((short)6, "macaddress");
+ MACADDRESS((short)6, "macaddress"),
+ /**
+ *
+ * @see af_afi
+ */
+ AFI((short)7, "afi");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
return ESI;
case 6: // MACADDRESS
return MACADDRESS;
+ case 7: // AFI
+ return AFI;
default:
return null;
}
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.MACADDRESS, new org.apache.thrift.meta_data.FieldMetaData("macaddress", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.AFI, new org.apache.thrift.meta_data.FieldMetaData("afi", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, af_afi.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(withdrawRoute_args.class, metaDataMap);
}
String rd,
int ethtag,
String esi,
- String macaddress)
+ String macaddress,
+ af_afi afi)
{
this();
this.p_type = p_type;
setEthtagIsSet(true);
this.esi = esi;
this.macaddress = macaddress;
+ this.afi = afi;
}
/**
if (other.isSetMacaddress()) {
this.macaddress = other.macaddress;
}
+ if (other.isSetAfi()) {
+ this.afi = other.afi;
+ }
}
public withdrawRoute_args deepCopy() {
this.ethtag = 0;
this.esi = null;
this.macaddress = null;
+ this.afi = null;
}
/**
}
}
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi getAfi() {
+ return this.afi;
+ }
+
+ /**
+ *
+ * @see af_afi
+ */
+ public withdrawRoute_args setAfi(af_afi afi) {
+ this.afi = afi;
+ return this;
+ }
+
+ public void unsetAfi() {
+ this.afi = null;
+ }
+
+ /** Returns true if field afi is set (has been assigned a value) and false otherwise */
+ public boolean isSetAfi() {
+ return this.afi != null;
+ }
+
+ public void setAfiIsSet(boolean value) {
+ if (!value) {
+ this.afi = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case P_TYPE:
}
break;
+ case AFI:
+ if (value == null) {
+ unsetAfi();
+ } else {
+ setAfi((af_afi)value);
+ }
+ break;
+
}
}
case MACADDRESS:
return getMacaddress();
+ case AFI:
+ return getAfi();
+
}
throw new IllegalStateException();
}
return isSetEsi();
case MACADDRESS:
return isSetMacaddress();
+ case AFI:
+ return isSetAfi();
}
throw new IllegalStateException();
}
return false;
}
+ boolean this_present_afi = true && this.isSetAfi();
+ boolean that_present_afi = true && that.isSetAfi();
+ if (this_present_afi || that_present_afi) {
+ if (!(this_present_afi && that_present_afi))
+ return false;
+ if (!this.afi.equals(that.afi))
+ return false;
+ }
+
return true;
}
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetAfi()).compareTo(other.isSetAfi());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAfi()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.afi, other.afi);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
sb.append(this.macaddress);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("afi:");
+ if (this.afi == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.afi);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 7: // AFI
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
oprot.writeString(struct.macaddress);
oprot.writeFieldEnd();
}
+ if (struct.afi != null) {
+ oprot.writeFieldBegin(AFI_FIELD_DESC);
+ oprot.writeI32(struct.afi.getValue());
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
if (struct.isSetMacaddress()) {
optionals.set(5);
}
- oprot.writeBitSet(optionals, 6);
+ if (struct.isSetAfi()) {
+ optionals.set(6);
+ }
+ oprot.writeBitSet(optionals, 7);
if (struct.isSetP_type()) {
oprot.writeI32(struct.p_type.getValue());
}
if (struct.isSetMacaddress()) {
oprot.writeString(struct.macaddress);
}
+ if (struct.isSetAfi()) {
+ oprot.writeI32(struct.afi.getValue());
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, withdrawRoute_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(6);
+ BitSet incoming = iprot.readBitSet(7);
if (incoming.get(0)) {
struct.p_type = protocol_type.findByValue(iprot.readI32());
struct.setP_typeIsSet(true);
struct.macaddress = iprot.readString();
struct.setMacaddressIsSet(true);
}
+ if (incoming.get(6)) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ }
}
}
private static final org.apache.thrift.protocol.TField P_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("p_type", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField OPTYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("optype", org.apache.thrift.protocol.TType.I32, (short)2);
private static final org.apache.thrift.protocol.TField WIN_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("winSize", org.apache.thrift.protocol.TType.I32, (short)3);
+ private static final org.apache.thrift.protocol.TField AFI_FIELD_DESC = new org.apache.thrift.protocol.TField("afi", org.apache.thrift.protocol.TType.I32, (short)4);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
public protocol_type p_type; // required
public int optype; // required
public int winSize; // required
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi afi; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
*/
P_TYPE((short)1, "p_type"),
OPTYPE((short)2, "optype"),
- WIN_SIZE((short)3, "winSize");
+ WIN_SIZE((short)3, "winSize"),
+ /**
+ *
+ * @see af_afi
+ */
+ AFI((short)4, "afi");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
return OPTYPE;
case 3: // WIN_SIZE
return WIN_SIZE;
+ case 4: // AFI
+ return AFI;
default:
return null;
}
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.WIN_SIZE, new org.apache.thrift.meta_data.FieldMetaData("winSize", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.AFI, new org.apache.thrift.meta_data.FieldMetaData("afi", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, af_afi.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRoutes_args.class, metaDataMap);
}
public getRoutes_args(
protocol_type p_type,
int optype,
- int winSize)
+ int winSize,
+ af_afi afi)
{
this();
this.p_type = p_type;
setOptypeIsSet(true);
this.winSize = winSize;
setWinSizeIsSet(true);
+ this.afi = afi;
}
/**
}
this.optype = other.optype;
this.winSize = other.winSize;
+ if (other.isSetAfi()) {
+ this.afi = other.afi;
+ }
}
public getRoutes_args deepCopy() {
this.optype = 0;
setWinSizeIsSet(false);
this.winSize = 0;
+ this.afi = null;
}
/**
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WINSIZE_ISSET_ID, value);
}
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi getAfi() {
+ return this.afi;
+ }
+
+ /**
+ *
+ * @see af_afi
+ */
+ public getRoutes_args setAfi(af_afi afi) {
+ this.afi = afi;
+ return this;
+ }
+
+ public void unsetAfi() {
+ this.afi = null;
+ }
+
+ /** Returns true if field afi is set (has been assigned a value) and false otherwise */
+ public boolean isSetAfi() {
+ return this.afi != null;
+ }
+
+ public void setAfiIsSet(boolean value) {
+ if (!value) {
+ this.afi = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case P_TYPE:
}
break;
+ case AFI:
+ if (value == null) {
+ unsetAfi();
+ } else {
+ setAfi((af_afi)value);
+ }
+ break;
+
}
}
case WIN_SIZE:
return Integer.valueOf(getWinSize());
+ case AFI:
+ return getAfi();
+
}
throw new IllegalStateException();
}
return isSetOptype();
case WIN_SIZE:
return isSetWinSize();
+ case AFI:
+ return isSetAfi();
}
throw new IllegalStateException();
}
return false;
}
+ boolean this_present_afi = true && this.isSetAfi();
+ boolean that_present_afi = true && that.isSetAfi();
+ if (this_present_afi || that_present_afi) {
+ if (!(this_present_afi && that_present_afi))
+ return false;
+ if (!this.afi.equals(that.afi))
+ return false;
+ }
+
return true;
}
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetAfi()).compareTo(other.isSetAfi());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAfi()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.afi, other.afi);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
sb.append("winSize:");
sb.append(this.winSize);
first = false;
+ if (!first) sb.append(", ");
+ sb.append("afi:");
+ if (this.afi == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.afi);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 4: // AFI
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
oprot.writeFieldBegin(WIN_SIZE_FIELD_DESC);
oprot.writeI32(struct.winSize);
oprot.writeFieldEnd();
+ if (struct.afi != null) {
+ oprot.writeFieldBegin(AFI_FIELD_DESC);
+ oprot.writeI32(struct.afi.getValue());
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
if (struct.isSetWinSize()) {
optionals.set(2);
}
- oprot.writeBitSet(optionals, 3);
+ if (struct.isSetAfi()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
if (struct.isSetP_type()) {
oprot.writeI32(struct.p_type.getValue());
}
if (struct.isSetWinSize()) {
oprot.writeI32(struct.winSize);
}
+ if (struct.isSetAfi()) {
+ oprot.writeI32(struct.afi.getValue());
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getRoutes_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
+ BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.p_type = protocol_type.findByValue(iprot.readI32());
struct.setP_typeIsSet(true);
struct.winSize = iprot.readI32();
struct.setWinSizeIsSet(true);
}
+ if (incoming.get(3)) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ }
}
}
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
public interface Iface {
- public void onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac) throws org.apache.thrift.TException;
+ public void onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac, af_afi afi) throws org.apache.thrift.TException;
- public void onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label) throws org.apache.thrift.TException;
+ public void onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, af_afi afi) throws org.apache.thrift.TException;
public void onStartConfigResyncNotification() throws org.apache.thrift.TException;
public interface AsyncIface {
- public void onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void onStartConfigResyncNotification(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
super(iprot, oprot);
}
- public void onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac) throws org.apache.thrift.TException
+ public void onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac, af_afi afi) throws org.apache.thrift.TException
{
- send_onUpdatePushRoute(p_type, rd, prefix, prefixlen, nexthop, ethtag, esi, macaddress, l3label, l2label, routermac);
+ send_onUpdatePushRoute(p_type, rd, prefix, prefixlen, nexthop, ethtag, esi, macaddress, l3label, l2label, routermac, afi);
}
- public void send_onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac) throws org.apache.thrift.TException
+ public void send_onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac, af_afi afi) throws org.apache.thrift.TException
{
onUpdatePushRoute_args args = new onUpdatePushRoute_args();
args.setP_type(p_type);
args.setL3label(l3label);
args.setL2label(l2label);
args.setRoutermac(routermac);
+ args.setAfi(afi);
sendBase("onUpdatePushRoute", args);
}
- public void onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label) throws org.apache.thrift.TException
+ public void onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, af_afi afi) throws org.apache.thrift.TException
{
- send_onUpdateWithdrawRoute(p_type, rd, prefix, prefixlen, nexthop, ethtag, esi, macaddress, l3label, l2label);
+ send_onUpdateWithdrawRoute(p_type, rd, prefix, prefixlen, nexthop, ethtag, esi, macaddress, l3label, l2label, afi);
}
- public void send_onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label) throws org.apache.thrift.TException
+ public void send_onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, af_afi afi) throws org.apache.thrift.TException
{
onUpdateWithdrawRoute_args args = new onUpdateWithdrawRoute_args();
args.setP_type(p_type);
args.setMacaddress(macaddress);
args.setL3label(l3label);
args.setL2label(l2label);
+ args.setAfi(afi);
sendBase("onUpdateWithdrawRoute", args);
}
super(protocolFactory, clientManager, transport);
}
- public void onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void onUpdatePushRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- onUpdatePushRoute_call method_call = new onUpdatePushRoute_call(p_type, rd, prefix, prefixlen, nexthop, ethtag, esi, macaddress, l3label, l2label, routermac, resultHandler, this, ___protocolFactory, ___transport);
+ onUpdatePushRoute_call method_call = new onUpdatePushRoute_call(p_type, rd, prefix, prefixlen, nexthop, ethtag, esi, macaddress, l3label, l2label, routermac, afi, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
private int l3label;
private int l2label;
private String routermac;
- public onUpdatePushRoute_call(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private af_afi afi;
+ public onUpdatePushRoute_call(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, String routermac, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, true);
this.p_type = p_type;
this.rd = rd;
this.l3label = l3label;
this.l2label = l2label;
this.routermac = routermac;
+ this.afi = afi;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
args.setL3label(l3label);
args.setL2label(l2label);
args.setRoutermac(routermac);
+ args.setAfi(afi);
args.write(prot);
prot.writeMessageEnd();
}
}
}
- public void onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void onUpdateWithdrawRoute(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- onUpdateWithdrawRoute_call method_call = new onUpdateWithdrawRoute_call(p_type, rd, prefix, prefixlen, nexthop, ethtag, esi, macaddress, l3label, l2label, resultHandler, this, ___protocolFactory, ___transport);
+ onUpdateWithdrawRoute_call method_call = new onUpdateWithdrawRoute_call(p_type, rd, prefix, prefixlen, nexthop, ethtag, esi, macaddress, l3label, l2label, afi, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
private String macaddress;
private int l3label;
private int l2label;
- public onUpdateWithdrawRoute_call(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private af_afi afi;
+ public onUpdateWithdrawRoute_call(protocol_type p_type, String rd, String prefix, int prefixlen, String nexthop, int ethtag, String esi, String macaddress, int l3label, int l2label, af_afi afi, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, true);
this.p_type = p_type;
this.rd = rd;
this.macaddress = macaddress;
this.l3label = l3label;
this.l2label = l2label;
+ this.afi = afi;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
args.setMacaddress(macaddress);
args.setL3label(l3label);
args.setL2label(l2label);
+ args.setAfi(afi);
args.write(prot);
prot.writeMessageEnd();
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
- super(iface, getProcessMap(new HashMap<>()));
+ super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
}
public org.apache.thrift.TBase getResult(I iface, onUpdatePushRoute_args args) throws org.apache.thrift.TException {
- iface.onUpdatePushRoute(args.p_type, args.rd, args.prefix, args.prefixlen, args.nexthop, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.routermac);
+ iface.onUpdatePushRoute(args.p_type, args.rd, args.prefix, args.prefixlen, args.nexthop, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.routermac, args.afi);
return null;
}
}
}
public org.apache.thrift.TBase getResult(I iface, onUpdateWithdrawRoute_args args) throws org.apache.thrift.TException {
- iface.onUpdateWithdrawRoute(args.p_type, args.rd, args.prefix, args.prefixlen, args.nexthop, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label);
+ iface.onUpdateWithdrawRoute(args.p_type, args.rd, args.prefix, args.prefixlen, args.nexthop, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.afi);
return null;
}
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
- super(iface, getProcessMap(new HashMap<>()));
+ super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
}
protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
}
public void start(I iface, onUpdatePushRoute_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
- iface.onUpdatePushRoute(args.p_type, args.rd, args.prefix, args.prefixlen, args.nexthop, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.routermac,resultHandler);
+ iface.onUpdatePushRoute(args.p_type, args.rd, args.prefix, args.prefixlen, args.nexthop, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.routermac, args.afi,resultHandler);
}
}
}
public void start(I iface, onUpdateWithdrawRoute_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
- iface.onUpdateWithdrawRoute(args.p_type, args.rd, args.prefix, args.prefixlen, args.nexthop, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label,resultHandler);
+ iface.onUpdateWithdrawRoute(args.p_type, args.rd, args.prefix, args.prefixlen, args.nexthop, args.ethtag, args.esi, args.macaddress, args.l3label, args.l2label, args.afi,resultHandler);
}
}
private static final org.apache.thrift.protocol.TField L3LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("l3label", org.apache.thrift.protocol.TType.I32, (short)9);
private static final org.apache.thrift.protocol.TField L2LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("l2label", org.apache.thrift.protocol.TType.I32, (short)10);
private static final org.apache.thrift.protocol.TField ROUTERMAC_FIELD_DESC = new org.apache.thrift.protocol.TField("routermac", org.apache.thrift.protocol.TType.STRING, (short)11);
+ private static final org.apache.thrift.protocol.TField AFI_FIELD_DESC = new org.apache.thrift.protocol.TField("afi", org.apache.thrift.protocol.TType.I32, (short)12);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new onUpdatePushRoute_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new onUpdatePushRoute_argsTupleSchemeFactory());
public int l3label; // required
public int l2label; // required
public String routermac; // required
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi afi; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
MACADDRESS((short)8, "macaddress"),
L3LABEL((short)9, "l3label"),
L2LABEL((short)10, "l2label"),
- ROUTERMAC((short)11, "routermac");
+ ROUTERMAC((short)11, "routermac"),
+ /**
+ *
+ * @see af_afi
+ */
+ AFI((short)12, "afi");
- private static final Map<String, _Fields> byName = new HashMap<>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
return L2LABEL;
case 11: // ROUTERMAC
return ROUTERMAC;
+ case 12: // AFI
+ return AFI;
default:
return null;
}
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.ROUTERMAC, new org.apache.thrift.meta_data.FieldMetaData("routermac", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.AFI, new org.apache.thrift.meta_data.FieldMetaData("afi", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, af_afi.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(onUpdatePushRoute_args.class, metaDataMap);
}
String macaddress,
int l3label,
int l2label,
- String routermac)
+ String routermac,
+ af_afi afi)
{
this();
this.p_type = p_type;
this.l2label = l2label;
setL2labelIsSet(true);
this.routermac = routermac;
+ this.afi = afi;
}
/**
if (other.isSetRoutermac()) {
this.routermac = other.routermac;
}
+ if (other.isSetAfi()) {
+ this.afi = other.afi;
+ }
}
public onUpdatePushRoute_args deepCopy() {
setL2labelIsSet(false);
this.l2label = 0;
this.routermac = null;
+ this.afi = null;
}
/**
}
}
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi getAfi() {
+ return this.afi;
+ }
+
+ /**
+ *
+ * @see af_afi
+ */
+ public onUpdatePushRoute_args setAfi(af_afi afi) {
+ this.afi = afi;
+ return this;
+ }
+
+ public void unsetAfi() {
+ this.afi = null;
+ }
+
+ /** Returns true if field afi is set (has been assigned a value) and false otherwise */
+ public boolean isSetAfi() {
+ return this.afi != null;
+ }
+
+ public void setAfiIsSet(boolean value) {
+ if (!value) {
+ this.afi = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case P_TYPE:
}
break;
+ case AFI:
+ if (value == null) {
+ unsetAfi();
+ } else {
+ setAfi((af_afi)value);
+ }
+ break;
+
}
}
case ROUTERMAC:
return getRoutermac();
+ case AFI:
+ return getAfi();
+
}
throw new IllegalStateException();
}
return isSetL2label();
case ROUTERMAC:
return isSetRoutermac();
+ case AFI:
+ return isSetAfi();
}
throw new IllegalStateException();
}
return false;
}
+ boolean this_present_afi = true && this.isSetAfi();
+ boolean that_present_afi = true && that.isSetAfi();
+ if (this_present_afi || that_present_afi) {
+ if (!(this_present_afi && that_present_afi))
+ return false;
+ if (!this.afi.equals(that.afi))
+ return false;
+ }
+
return true;
}
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetAfi()).compareTo(other.isSetAfi());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAfi()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.afi, other.afi);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
sb.append(this.routermac);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("afi:");
+ if (this.afi == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.afi);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 12: // AFI
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
oprot.writeString(struct.routermac);
oprot.writeFieldEnd();
}
+ if (struct.afi != null) {
+ oprot.writeFieldBegin(AFI_FIELD_DESC);
+ oprot.writeI32(struct.afi.getValue());
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
if (struct.isSetRoutermac()) {
optionals.set(10);
}
- oprot.writeBitSet(optionals, 11);
+ if (struct.isSetAfi()) {
+ optionals.set(11);
+ }
+ oprot.writeBitSet(optionals, 12);
if (struct.isSetP_type()) {
oprot.writeI32(struct.p_type.getValue());
}
if (struct.isSetRoutermac()) {
oprot.writeString(struct.routermac);
}
+ if (struct.isSetAfi()) {
+ oprot.writeI32(struct.afi.getValue());
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, onUpdatePushRoute_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(11);
+ BitSet incoming = iprot.readBitSet(12);
if (incoming.get(0)) {
struct.p_type = protocol_type.findByValue(iprot.readI32());
struct.setP_typeIsSet(true);
struct.routermac = iprot.readString();
struct.setRoutermacIsSet(true);
}
+ if (incoming.get(11)) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ }
}
}
private static final org.apache.thrift.protocol.TField MACADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("macaddress", org.apache.thrift.protocol.TType.STRING, (short)8);
private static final org.apache.thrift.protocol.TField L3LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("l3label", org.apache.thrift.protocol.TType.I32, (short)9);
private static final org.apache.thrift.protocol.TField L2LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("l2label", org.apache.thrift.protocol.TType.I32, (short)10);
+ private static final org.apache.thrift.protocol.TField AFI_FIELD_DESC = new org.apache.thrift.protocol.TField("afi", org.apache.thrift.protocol.TType.I32, (short)11);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new onUpdateWithdrawRoute_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new onUpdateWithdrawRoute_argsTupleSchemeFactory());
public String macaddress; // required
public int l3label; // required
public int l2label; // required
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi afi; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ESI((short)7, "esi"),
MACADDRESS((short)8, "macaddress"),
L3LABEL((short)9, "l3label"),
- L2LABEL((short)10, "l2label");
+ L2LABEL((short)10, "l2label"),
+ /**
+ *
+ * @see af_afi
+ */
+ AFI((short)11, "afi");
- private static final Map<String, _Fields> byName = new HashMap<>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
return L3LABEL;
case 10: // L2LABEL
return L2LABEL;
+ case 11: // AFI
+ return AFI;
default:
return null;
}
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.L2LABEL, new org.apache.thrift.meta_data.FieldMetaData("l2label", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.AFI, new org.apache.thrift.meta_data.FieldMetaData("afi", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, af_afi.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(onUpdateWithdrawRoute_args.class, metaDataMap);
}
String esi,
String macaddress,
int l3label,
- int l2label)
+ int l2label,
+ af_afi afi)
{
this();
this.p_type = p_type;
setL3labelIsSet(true);
this.l2label = l2label;
setL2labelIsSet(true);
+ this.afi = afi;
}
/**
}
this.l3label = other.l3label;
this.l2label = other.l2label;
+ if (other.isSetAfi()) {
+ this.afi = other.afi;
+ }
}
public onUpdateWithdrawRoute_args deepCopy() {
this.l3label = 0;
setL2labelIsSet(false);
this.l2label = 0;
+ this.afi = null;
}
/**
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __L2LABEL_ISSET_ID, value);
}
+ /**
+ *
+ * @see af_afi
+ */
+ public af_afi getAfi() {
+ return this.afi;
+ }
+
+ /**
+ *
+ * @see af_afi
+ */
+ public onUpdateWithdrawRoute_args setAfi(af_afi afi) {
+ this.afi = afi;
+ return this;
+ }
+
+ public void unsetAfi() {
+ this.afi = null;
+ }
+
+ /** Returns true if field afi is set (has been assigned a value) and false otherwise */
+ public boolean isSetAfi() {
+ return this.afi != null;
+ }
+
+ public void setAfiIsSet(boolean value) {
+ if (!value) {
+ this.afi = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case P_TYPE:
}
break;
+ case AFI:
+ if (value == null) {
+ unsetAfi();
+ } else {
+ setAfi((af_afi)value);
+ }
+ break;
+
}
}
case L2LABEL:
return Integer.valueOf(getL2label());
+ case AFI:
+ return getAfi();
+
}
throw new IllegalStateException();
}
return isSetL3label();
case L2LABEL:
return isSetL2label();
+ case AFI:
+ return isSetAfi();
}
throw new IllegalStateException();
}
return false;
}
+ boolean this_present_afi = true && this.isSetAfi();
+ boolean that_present_afi = true && that.isSetAfi();
+ if (this_present_afi || that_present_afi) {
+ if (!(this_present_afi && that_present_afi))
+ return false;
+ if (!this.afi.equals(that.afi))
+ return false;
+ }
+
return true;
}
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetAfi()).compareTo(other.isSetAfi());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAfi()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.afi, other.afi);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
sb.append("l2label:");
sb.append(this.l2label);
first = false;
+ if (!first) sb.append(", ");
+ sb.append("afi:");
+ if (this.afi == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.afi);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 11: // AFI
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
oprot.writeFieldBegin(L2LABEL_FIELD_DESC);
oprot.writeI32(struct.l2label);
oprot.writeFieldEnd();
+ if (struct.afi != null) {
+ oprot.writeFieldBegin(AFI_FIELD_DESC);
+ oprot.writeI32(struct.afi.getValue());
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
if (struct.isSetL2label()) {
optionals.set(9);
}
- oprot.writeBitSet(optionals, 10);
+ if (struct.isSetAfi()) {
+ optionals.set(10);
+ }
+ oprot.writeBitSet(optionals, 11);
if (struct.isSetP_type()) {
oprot.writeI32(struct.p_type.getValue());
}
if (struct.isSetL2label()) {
oprot.writeI32(struct.l2label);
}
+ if (struct.isSetAfi()) {
+ oprot.writeI32(struct.afi.getValue());
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, onUpdateWithdrawRoute_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(10);
+ BitSet incoming = iprot.readBitSet(11);
if (incoming.get(0)) {
struct.p_type = protocol_type.findByValue(iprot.readI32());
struct.setP_typeIsSet(true);
struct.l2label = iprot.readI32();
struct.setL2labelIsSet(true);
}
+ if (incoming.get(10)) {
+ struct.afi = af_afi.findByValue(iprot.readI32());
+ struct.setAfiIsSet(true);
+ }
}
}
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("onStartConfigResyncNotification_args");
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new onStartConfigResyncNotification_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new onStartConfigResyncNotification_argsTupleSchemeFactory());
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
- private static final Map<String, _Fields> byName = new HashMap<>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(onStartConfigResyncNotification_args.class, metaDataMap);
}
private static final org.apache.thrift.protocol.TField ERR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errCode", org.apache.thrift.protocol.TType.BYTE, (short)2);
private static final org.apache.thrift.protocol.TField ERR_SUBCODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errSubcode", org.apache.thrift.protocol.TType.BYTE, (short)3);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new onNotificationSendEvent_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new onNotificationSendEvent_argsTupleSchemeFactory());
ERR_CODE((short)2, "errCode"),
ERR_SUBCODE((short)3, "errSubcode");
- private static final Map<String, _Fields> byName = new HashMap<>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
}
}
-
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
private static final org.apache.thrift.protocol.TField UPDATES_FIELD_DESC = new org.apache.thrift.protocol.TField("updates", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField MORE_FIELD_DESC = new org.apache.thrift.protocol.TField("more", org.apache.thrift.protocol.TType.I32, (short)4);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new RoutesStandardSchemeFactory());
schemes.put(TupleScheme.class, new RoutesTupleSchemeFactory());
UPDATES((short)2, "updates"),
MORE((short)4, "more");
- private static final Map<String, _Fields> byName = new HashMap<>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
private _Fields optionals[] = {_Fields.UPDATES,_Fields.MORE};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ERRCODE, new org.apache.thrift.meta_data.FieldMetaData("errcode", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.UPDATES, new org.apache.thrift.meta_data.FieldMetaData("updates", org.apache.thrift.TFieldRequirementType.OPTIONAL,
__isset_bitfield = other.__isset_bitfield;
this.errcode = other.errcode;
if (other.isSetUpdates()) {
- List<Update> __this__updates = new ArrayList<>(other.updates.size());
+ List<Update> __this__updates = new ArrayList<Update>(other.updates.size());
for (Update other_element : other.updates) {
__this__updates.add(new Update(other_element));
}
public void addToUpdates(Update elem) {
if (this.updates == null) {
- this.updates = new ArrayList<>();
+ this.updates = new ArrayList<Update>();
}
this.updates.add(elem);
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ERRCODE:
- return getErrcode();
+ return Integer.valueOf(getErrcode());
case UPDATES:
return getUpdates();
case MORE:
- return getMore();
+ return Integer.valueOf(getMore());
}
throw new IllegalStateException();
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
- struct.updates = new ArrayList<>(_list0.size);
+ struct.updates = new ArrayList<Update>(_list0.size);
for (int _i1 = 0; _i1 < _list0.size; ++_i1)
{
Update _elem2;
if (incoming.get(1)) {
{
org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.updates = new ArrayList<>(_list5.size);
+ struct.updates = new ArrayList<Update>(_list5.size);
for (int _i6 = 0; _i6 < _list5.size; ++_i6)
{
Update _elem7;
}
-
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
private static final org.apache.thrift.protocol.TField NEXTHOP_FIELD_DESC = new org.apache.thrift.protocol.TField("nexthop", org.apache.thrift.protocol.TType.STRING, (short)11);
private static final org.apache.thrift.protocol.TField ROUTERMAC_FIELD_DESC = new org.apache.thrift.protocol.TField("routermac", org.apache.thrift.protocol.TType.STRING, (short)12);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<>();
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new UpdateStandardSchemeFactory());
schemes.put(TupleScheme.class, new UpdateTupleSchemeFactory());
NEXTHOP((short)11, "nexthop"),
ROUTERMAC((short)12, "routermac");
- private static final Map<String, _Fields> byName = new HashMap<>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.RESERVED, new org.apache.thrift.meta_data.FieldMetaData("reserved", org.apache.thrift.TFieldRequirementType.DEFAULT,
public Object getFieldValue(_Fields field) {
switch (field) {
case TYPE:
- return getType();
+ return Integer.valueOf(getType());
case RESERVED:
- return getReserved();
+ return Integer.valueOf(getReserved());
case PREFIXLEN:
- return getPrefixlen();
+ return Integer.valueOf(getPrefixlen());
case L3LABEL:
return Integer.valueOf(getL3label());
}
-
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
public enum af_afi implements org.apache.thrift.TEnum {
AFI_IP(1),
+ AFI_IPV6(2),
AFI_L2VPN(3);
private final int value;
switch (value) {
case 1:
return AFI_IP;
+ case 2:
+ return AFI_IPV6;
case 3:
return AFI_L2VPN;
default:
}
}
}
-
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
}
}
}
-
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
}
}
}
-
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
}
}
}
-
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
}
}
}
-
-/**
+ /**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-
-package org.opendaylight.netvirt.bgpmanager.thrift.gen;
-
+ package org.opendaylight.netvirt.bgpmanager.thrift.gen;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
public static final int BGP_ERR_NOT_SUPPORTED = 200;
}
-
// these are the supported afi-safi combinations
enum af_afi {
AFI_IP = 1,
+ AFI_IPV6 = 2,
AFI_L2VPN = 3
}
i32 delVrf(1:string rd),
/*
* pushRoute:
- * IPv6 is not supported.
+ * IPv6 is now supported through af_afi parameter, 'af_afi': indicates whether prefix is IPv4 or IPv6.
* 'p_type' is mandatory
* 'nexthop' cannot be null for VPNv4 and LU.
* 'rd' is null for LU (and unicast).
8:i32 l3label,
9:i32 l2label,
10:encap_type enc_type,
- 11:string routermac),
+ 11:string routermac,
+ 12:af_afi afi),
/*
* 'p_type' is mandatory
* kludge: second argument is either 'rd' (VPNv4) or
* label (v4LU) as a string (eg: "2500")
+ * seventh argument is either ipv4 or ipv6
*/
i32 withdrawRoute(
1:protocol_type p_type,
3:string rd,
4:i32 ethtag,
5:string esi,
- 6:string macaddress),
+ 6:string macaddress,
+ 7:af_afi afi),
+
i32 setEbgpMultihop(1:string peerIp, 2:i32 nHops),
i32 unsetEbgpMultihop(1:string peerIp),
* but not necessarily the maximum number that would fit
* (we currently use min(winSize, tcpWindowSize) ).
* calling INIT when NEXT is expected causes reinit.
- * only vpnv4 RIBs are supported.
+ * both vpnv4 or vpnv6 RIBs are supported.
*/
- Routes getRoutes(1:protocol_type p_type, 2:i32 optype, 3:i32 winSize),
+ Routes getRoutes(1:protocol_type p_type, 2:i32 optype, 3:i32 winSize, 4:af_afi afi),
i32 enableMultipath(1:af_afi afi, 2:af_safi safi),
i32 disableMultipath(1:af_afi afi, 2:af_safi safi),
i32 multipaths(1:string rd, 2:i32 maxPath)
8:string macaddress,
9:i32 l3label,
10:i32 l2label,
- 11:string routermac),
+ 11:string routermac,
+ 12:af_afi afi),
oneway void onUpdateWithdrawRoute(
1:protocol_type p_type,
7:string esi,
8:string macaddress,
9:i32 l3label,
- 10:i32 l2label),
+ 10:i32 l2label,
+ 11:af_afi afi),
oneway void onStartConfigResyncNotification(),
/* communicate to ODL a BGP Notification received from peer */
import org.opendaylight.netvirt.bgpmanager.FibDSWriter;
import org.opendaylight.netvirt.bgpmanager.api.IBgpManager;
import org.opendaylight.netvirt.bgpmanager.thrift.gen.BgpUpdater;
+import org.opendaylight.netvirt.bgpmanager.thrift.gen.af_afi;
import org.opendaylight.netvirt.bgpmanager.thrift.gen.protocol_type;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTables;
import org.slf4j.Logger;
String macaddress,
int l3label,
int l2label,
- String routermac) {
+ String routermac,
+ af_afi afi) {
try {
LOGGER.debug("Update on push route : rd {} prefix {} plen {}", rd, prefix, plen);
esi,
macaddress,
l3label,
- routermac);
+ routermac,
+ afi);
} catch (Throwable e) {
LOGGER.error("failed to handle update route ", e);
String esi,
String macaddress,
int l3label,
- int l2label) {
+ int l2label,
+ af_afi afi) {
LOGGER.debug("Route del ** {} ** {}/{} ", rd, prefix, plen);
LOGGER.info("REMOVE: Removing Fib entry rd {} prefix {} nexthop {}", rd, prefix, nexthop);
fibDSWriter.removeOrUpdateFibEntryFromDS(rd, prefix + "/" + plen, nexthop);
/* Publish to Bgp only if its an INTERNET VPN */
if ((rd != null) && (!rd.equalsIgnoreCase(vpnName))) {
bgpManager.advertisePrefix(rd, null /*macAddress*/, prefix, Collections.singletonList(nextHopIp),
- VrfEntry.EncapType.Vxlan, NatConstants.DEFAULT_LABEL_VALUE, l3Vni, 0 /*l2vni*/, gwMacAddress);
+ VrfEntry.EncapType.Vxlan, NatConstants.DEFAULT_LABEL_VALUE, l3Vni, 0 /*l2vni*/,
+ gwMacAddress);
}
LOG.info("NAT Service : ADD: Added Fib entry rd {} prefix {} nextHop {} l3Vni {}", rd, prefix,
nextHopIp, l3Vni);
if (rd != null && !rd.equalsIgnoreCase(vpnName)) {
/* Publish to Bgp only if its an INTERNET VPN */
bgpManager.advertisePrefix(rd, null /*macAddress*/, prefix, Collections.singletonList(nextHopIp),
- VrfEntry.EncapType.Mplsgre, (int) label, 0 /*l3vni*/, 0 /*l2vni*/, null /*gatewayMac*/);
+ VrfEntry.EncapType.Mplsgre, (int) label, 0 /*l3vni*/, 0 /*l2vni*/,
+ null /*gatewayMac*/);
}
LOG.info("NAT Service : ADD: Added Fib entry rd {} prefix {} nextHop {} label {}", rd,
prefix, nextHopIp, label);
LOG.info("VPN ADVERTISE: Adding Fib Entry rd {} prefix {} nexthop {} label {}", rd,
nextHop.getIpAddress(), nextHopIp, label);
bgpManager.advertisePrefix(rd, nextHop.getMacAddress(), nextHop.getIpAddress(), nextHopIp,
- encapType, (int)label, l3vni, 0 /*l2vni*/, gatewayMac);
+ encapType, (int)label, l3vni, 0 /*l2vni*/,
+ gatewayMac);
LOG.info("VPN ADVERTISE: Added Fib Entry rd {} prefix {} nexthop {} label {}", rd,
nextHop.getIpAddress(), nextHopIp, label);
} catch (Exception e) {
}
fibManager.removeOrUpdateFibEntry(dataBroker, primaryRd, prefix, tunnelIp, writeConfigTxn);
if (rd != null && !rd.equalsIgnoreCase(vpnName)) {
- bgpManager.withdrawPrefix(rd, prefix); // TODO: Might be needed to include nextHop here
+ // TODO: Might be needed to include nextHop here
+ bgpManager.withdrawPrefix(rd, prefix);
}
}
LOG.info("VPN WITHDRAW: Removed Fib Entry rd {} prefix {}", rd, prefix);
//already exist
long label = 0;
long l3vni = 0;
+
VrfEntry.EncapType encapType = VpnUtil.getEncapType(VpnUtil.isL3VpnOverVxLan(l3vni));
if (encapType.equals(VrfEntry.EncapType.Vxlan)) {
l3vni = subOpBuilder.getL3vni();
LOG.debug("advertising IVpnLink route to BGP: vpnRd={}, prefix={}, label={}, nexthops={}",
vpnRd, destination, label, nexthopList);
bgpManager.advertisePrefix(vpnRd, null /*macAddress*/, destination, nexthopList,
- VrfEntry.EncapType.Mplsgre, label, 0 /*l3vni*/, 0 /*l2vni*/, null /*gatewayMacAddress*/);
+ VrfEntry.EncapType.Mplsgre, label, 0 /*l3vni*/, 0 /*l2vni*/,
+ null /*gatewayMacAddress*/);
}
}