src/main/java/net/floodlightcontroller/myrouting/MyRouting.java
//add head and tail the route
add head and tail the route
add head and tail the route
private void addHeadAndTail(Route route, OFMatch match, FloodlightContext cntx) {
		List<NodePortTuple> pathNode = route.getPath();
		IDevice dstHost = IDeviceService.fcStore.get(cntx, IDeviceService.CONTEXT_DST_DEVICE);
		IDevice srcHost = IDeviceService.fcStore.get(cntx, IDeviceService.CONTEXT_SRC_DEVICE);
		SwitchPort[] srcDaps = srcHost.getAttachmentPoints();
		SwitchPort[] dstDaps = dstHost.getAttachmentPoints();
		NodePortTuple srcSwithport = new NodePortTuple(srcDaps[0].getSwitchDPID(), srcDaps[0].getPort());
		NodePortTuple dstSwithport = new NodePortTuple(dstDaps[0].getSwitchDPID(), dstDaps[0].getPort());
		pathNode.add(0, srcSwithport);
		pathNode.add(dstSwithport);
	}
private void addHeadAndTail ( Route route , OFMatch match , FloodlightContext cntx ) { List < NodePortTuple > pathNode = route . getPath ( ) ; IDevice dstHost = IDeviceService . fcStore . get ( cntx , IDeviceService . CONTEXT_DST_DEVICE ) ; IDevice srcHost = IDeviceService . fcStore . get ( cntx , IDeviceService . CONTEXT_SRC_DEVICE ) ; SwitchPort [ ] srcDaps = srcHost . getAttachmentPoints ( ) ; SwitchPort [ ] dstDaps = dstHost . getAttachmentPoints ( ) ; NodePortTuple srcSwithport = new NodePortTuple ( srcDaps [ 0 ] . getSwitchDPID ( ) , srcDaps [ 0 ] . getPort ( ) ) ; NodePortTuple dstSwithport = new NodePortTuple ( dstDaps [ 0 ] . getSwitchDPID ( ) , dstDaps [ 0 ] . getPort ( ) ) ; pathNode . add ( 0 , srcSwithport ) ; pathNode . add ( dstSwithport ) ; }
add head and tail the route
add head and tail the route