本文介绍packethander工程,该工程用于对进入到controller的packet进行解析并分发到不同的
模块进行处理。
工程分为四个部分:
config文件夹:packethander的配置信息,如plugin的部署顺序,初始化时的配置。
implementation文件夹:service的具体实现,包含了java和yang。
model文件夹:定义了packet相关的yang。
pom.xml
一、pom.xml
packethander的pom.xml文件很简单,主要包含一下两部分:
<parent>
<groupId>org.opendaylight.l2switch</groupId>
<artifactId>l2switch-parent</artifactId>
<version>0.4.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
该配置指向了之前讲的parent工程,说明packethander继承了parent,所以很多配置都可以省略。
<modules>
<module>model</module>
<module>implementation</module>
<module>config</module>
</modules>
该配置指向了config,implementation和model三个文件夹,maven会去这三个文件夹下面去找
pom.xml文件。
二、model
该目录包含了五个yang文件和一个pom.xml.
1.arp-packet.yang
该文件主要定义了一个grouping和一个notification。
grouping arp-packet-fields {
leaf xxx {
}
leaf xxx {
}
......
uses bp
模块进行处理。
工程分为四个部分:
config文件夹:packethander的配置信息,如plugin的部署顺序,初始化时的配置。
implementation文件夹:service的具体实现,包含了java和yang。
model文件夹:定义了packet相关的yang。
pom.xml
一、pom.xml
packethander的pom.xml文件很简单,主要包含一下两部分:
<parent>
<groupId>org.opendaylight.l2switch</groupId>
<artifactId>l2switch-parent</artifactId>
<version>0.4.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
该配置指向了之前讲的parent工程,说明packethander继承了parent,所以很多配置都可以省略。
<modules>
<module>model</module>
<module>implementation</module>
<module>config</module>
</modules>
该配置指向了config,implementation和model三个文件夹,maven会去这三个文件夹下面去找
pom.xml文件。
二、model
该目录包含了五个yang文件和一个pom.xml.
1.arp-packet.yang
该文件主要定义了一个grouping和一个notification。
grouping arp-packet-fields {
leaf xxx {
}
leaf xxx {
}
......
uses bp