Showing
4 changed files
with
123 additions
and
0 deletions
providers/of/flow/.checkstyle
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | + | ||
3 | +<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false"> | ||
4 | + <local-check-config name="maven-checkstyle-plugin validate-checkstyle" location="jar:file:/Users/ash/.m2/repository/org/onlab/tools/onos-build-conf/1.0/onos-build-conf-1.0.jar!/onos/checkstyle.xml" type="remote" description="maven-checkstyle-plugin configuration validate-checkstyle"> | ||
5 | + <property name="checkstyle.cache.file" value="${project_loc}/target/checkstyle-cachefile"/> | ||
6 | + <property name="checkstyle.suppressions.file" value="/Users/ash/work/onos-next/providers/of/host/target/checkstyle-suppressions-validate-checkstyle.xml"/> | ||
7 | + <property name="checkstyle.header.file" value="/Users/ash/work/onos-next/providers/of/host/target/checkstyle-header-validate-checkstyle.txt"/> | ||
8 | + </local-check-config> | ||
9 | + <fileset name="java-sources-validate-checkstyle" enabled="true" check-config-name="maven-checkstyle-plugin validate-checkstyle" local="true"> | ||
10 | + <file-match-pattern match-pattern="src/test/java.*\.java" include-pattern="true"/> | ||
11 | + <file-match-pattern match-pattern="src/main/java/.*\.java" include-pattern="true"/> | ||
12 | + <file-match-pattern match-pattern="src/main/resources.*\.properties" include-pattern="true"/> | ||
13 | + <file-match-pattern match-pattern="src/test/resources.*\.properties" include-pattern="true"/> | ||
14 | + </fileset> | ||
15 | +</fileset-config> |
providers/of/flow/pom.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
5 | + <modelVersion>4.0.0</modelVersion> | ||
6 | + | ||
7 | + <parent> | ||
8 | + <groupId>org.onlab.onos</groupId> | ||
9 | + <artifactId>onos-of-providers</artifactId> | ||
10 | + <version>1.0.0-SNAPSHOT</version> | ||
11 | + <relativePath>../pom.xml</relativePath> | ||
12 | + </parent> | ||
13 | + | ||
14 | + <artifactId>onos-of-provider-flow</artifactId> | ||
15 | + <packaging>bundle</packaging> | ||
16 | + | ||
17 | + <description>ONOS OpenFlow protocol flow provider</description> | ||
18 | + | ||
19 | +</project> |
providers/of/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/OpenFlowRuleProvider.java
0 → 100644
1 | +package org.onlab.onos.provider.of.flow.impl; | ||
2 | + | ||
3 | +import static org.slf4j.LoggerFactory.getLogger; | ||
4 | + | ||
5 | +import org.apache.felix.scr.annotations.Activate; | ||
6 | +import org.apache.felix.scr.annotations.Component; | ||
7 | +import org.apache.felix.scr.annotations.Deactivate; | ||
8 | +import org.apache.felix.scr.annotations.Reference; | ||
9 | +import org.apache.felix.scr.annotations.ReferenceCardinality; | ||
10 | +import org.onlab.onos.net.DeviceId; | ||
11 | +import org.onlab.onos.net.flow.FlowEntry; | ||
12 | +import org.onlab.onos.net.flow.FlowRule; | ||
13 | +import org.onlab.onos.net.flow.FlowRuleProvider; | ||
14 | +import org.onlab.onos.net.flow.FlowRuleProviderRegistry; | ||
15 | +import org.onlab.onos.net.flow.FlowRuleProviderService; | ||
16 | +import org.onlab.onos.net.provider.AbstractProvider; | ||
17 | +import org.onlab.onos.net.provider.ProviderId; | ||
18 | +import org.onlab.onos.net.topology.TopologyService; | ||
19 | +import org.onlab.onos.of.controller.OpenFlowController; | ||
20 | +import org.slf4j.Logger; | ||
21 | + | ||
22 | +/** | ||
23 | + * Provider which uses an OpenFlow controller to detect network | ||
24 | + * end-station hosts. | ||
25 | + */ | ||
26 | +@Component(immediate = true) | ||
27 | +public class OpenFlowRuleProvider extends AbstractProvider implements FlowRuleProvider { | ||
28 | + | ||
29 | + private final Logger log = getLogger(getClass()); | ||
30 | + | ||
31 | + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
32 | + protected FlowRuleProviderRegistry providerRegistry; | ||
33 | + | ||
34 | + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
35 | + protected OpenFlowController controller; | ||
36 | + | ||
37 | + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
38 | + protected TopologyService topologyService; | ||
39 | + | ||
40 | + private FlowRuleProviderService providerService; | ||
41 | + | ||
42 | + /** | ||
43 | + * Creates an OpenFlow host provider. | ||
44 | + */ | ||
45 | + public OpenFlowRuleProvider() { | ||
46 | + super(new ProviderId("org.onlab.onos.provider.openflow")); | ||
47 | + } | ||
48 | + | ||
49 | + @Activate | ||
50 | + public void activate() { | ||
51 | + providerService = providerRegistry.register(this); | ||
52 | + log.info("Started"); | ||
53 | + } | ||
54 | + | ||
55 | + @Deactivate | ||
56 | + public void deactivate() { | ||
57 | + providerRegistry.unregister(this); | ||
58 | + providerService = null; | ||
59 | + | ||
60 | + log.info("Stopped"); | ||
61 | + } | ||
62 | + @Override | ||
63 | + public void applyFlowRule(FlowRule... flowRules) { | ||
64 | + // TODO Auto-generated method stub | ||
65 | + | ||
66 | + } | ||
67 | + | ||
68 | + @Override | ||
69 | + public void removeFlowRule(FlowRule... flowRules) { | ||
70 | + // TODO Auto-generated method stub | ||
71 | + | ||
72 | + } | ||
73 | + | ||
74 | + @Override | ||
75 | + public Iterable<FlowEntry> getFlowMetrics(DeviceId deviceId) { | ||
76 | + // TODO Auto-generated method stub | ||
77 | + return null; | ||
78 | + } | ||
79 | + | ||
80 | + | ||
81 | + //TODO: InternalFlowRuleProvider listening to stats and error and flowremoved. | ||
82 | + // possibly barriers as well. May not be internal at all... | ||
83 | + | ||
84 | + | ||
85 | +} |
-
Please register or login to post a comment