+ public void installDhcpEntries(BigInteger dpnId, String vmMacAddress) {
+ DhcpServiceUtils.setupDhcpFlowEntry(dpnId, NwConstants.DHCP_TABLE, vmMacAddress, NwConstants.ADD_FLOW, mdsalUtil);
+ }
+
+ public void unInstallDhcpEntries(BigInteger dpId, String vmMacAddress) {
+ DhcpServiceUtils.setupDhcpFlowEntry(dpId, NwConstants.DHCP_TABLE, vmMacAddress, NwConstants.DEL_FLOW, mdsalUtil);
+ }
+
+ public void setupTableMissForDhcpTable(BigInteger dpId) {
+ List<MatchInfo> matches = new ArrayList<MatchInfo>();
+ List<InstructionInfo> instructions = new ArrayList<InstructionInfo>();
+ instructions.add(new InstructionInfo(InstructionType.goto_table, new long[] { NwConstants.LPORT_DISPATCHER_TABLE }));
+
+ FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.DHCP_TABLE, "DHCPTableMissFlow",
+ 0, "DHCP Table Miss Flow", 0, 0,
+ DHCPMConstants.COOKIE_DHCP_BASE, matches, instructions);
+ mdsalUtil.installFlow(flowEntity);
+ setupTableMissForHandlingExternalTunnel(dpId);
+ }
+
+ private void setupTableMissForHandlingExternalTunnel(BigInteger dpId) {
+ List<MatchInfo> matches = new ArrayList<MatchInfo>();
+ List<InstructionInfo> instructions = new ArrayList<InstructionInfo>();
+ instructions.add(new InstructionInfo(InstructionType.goto_table, new long[] { NwConstants.EXTERNAL_TUNNEL_TABLE }));
+
+ FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.DHCP_TABLE_EXTERNAL_TUNNEL, "DHCPTableMissFlowForExternalTunnel",
+ 0, "DHCP Table Miss Flow For External Tunnel", 0, 0,
+ DHCPMConstants.COOKIE_DHCP_BASE, matches, instructions);
+ mdsalUtil.installFlow(flowEntity);
+ }
+
+ public void updateInterfaceCache(String interfaceName, ImmutablePair<BigInteger, String> pair) {
+ interfaceToDpnIdMacAddress.put(interfaceName, pair);
+ }
+
+ public ImmutablePair<BigInteger, String> getInterfaceCache(String interfaceName) {
+ return interfaceToDpnIdMacAddress.get(interfaceName);
+ }
+
+ public void removeInterfaceCache(String interfaceName) {
+ interfaceToDpnIdMacAddress.remove(interfaceName);
+ }