blob: 5cf4b094c28b55e40281c9248d91c509dc9abad7 [file] [log] [blame]
Jonathan Hart4dfc3652013-08-02 20:22:36 +12001package net.onrc.onos.ofcontroller.bgproute;
2
3import java.net.InetAddress;
Jonathan Hart309889c2013-08-13 23:26:24 +12004import java.util.Collections;
5import java.util.List;
Jonathan Hart4dfc3652013-08-02 20:22:36 +12006
7/*
8 * A path is always assumed to be from all other interfaces (external-facing
9 * switchports) to the destination interface.
10 */
11
Jonathan Harta23ffdb2013-08-14 14:36:54 +120012public class Path {
Jonathan Hart4dfc3652013-08-02 20:22:36 +120013
Jonathan Hart4dfc3652013-08-02 20:22:36 +120014 private Interface dstInterface;
15 private InetAddress dstIpAddress;
Jonathan Hart309889c2013-08-13 23:26:24 +120016 private int numUsers = 0;
17
18 private List<PushedFlowMod> flowMods = null;
19 private boolean permanent = false;
Jonathan Hart4dfc3652013-08-02 20:22:36 +120020
Jonathan Harta23ffdb2013-08-14 14:36:54 +120021 public Path(Interface dstInterface, InetAddress dstIpAddress) {
Jonathan Hart4dfc3652013-08-02 20:22:36 +120022 this.dstInterface = dstInterface;
23 this.dstIpAddress = dstIpAddress;
Jonathan Hart4dfc3652013-08-02 20:22:36 +120024 }
25
Jonathan Hart4dfc3652013-08-02 20:22:36 +120026 public Interface getDstInterface() {
27 return dstInterface;
28 }
29
30 public InetAddress getDstIpAddress() {
31 return dstIpAddress;
32 }
Jonathan Hart309889c2013-08-13 23:26:24 +120033
34 public void incrementUsers() {
35 numUsers++;
36 }
37
38 public void decrementUsers() {
39 numUsers--;
40 }
41
42 public int getUsers() {
43 return numUsers;
44 }
45
46 public List<PushedFlowMod> getFlowMods() {
47 return Collections.unmodifiableList(flowMods);
48 }
49
50 public void setFlowMods(List<PushedFlowMod> flowMods) {
51 this.flowMods = flowMods;
52 }
53
54 public boolean isPermanent() {
55 return permanent;
56 }
57
58 public void setPermanent() {
59 permanent = true;
60 }
Jonathan Hart4dfc3652013-08-02 20:22:36 +120061}