Skip to content

Commit

Permalink
Application filtering API support in simapp
Browse files Browse the repository at this point in the history
  • Loading branch information
thakurajayL committed Sep 20, 2021
1 parent 91f383e commit 948f06b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 10 deletions.
6 changes: 6 additions & 0 deletions config/simapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ configuration:
permit-applications:
- iot-app1-permit
- iot-app2-permit
application-filtering-rules:
#list of all rules as per priority
- rule-name: rule1
priority: 10
action: "permit"
dest-network: "0.0.0.0/0"
qos:
downlink: 20000000
traffic-class: platinum
Expand Down
42 changes: 32 additions & 10 deletions simapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,17 @@ type SubProvisionEndpt struct {
}

type NetworkSlice struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
SliceId *SliceId `yaml:"slice-id,omitempty" json:"slice-id,omitempty"`
Qos *QosInfo `yaml:"qos,omitempty" json:"qos,omitempty"`
DevGroups []string `yaml:"site-device-group,omitempty" json:"site-device-group,omitempty"`
SiteInfo *SiteInfo `yaml:"site-info,omitempty" json:"site-info,omitempty"`
DenyApps []string `yaml:"deny-applications,omitempty" json:"deny-applications,omitempty"`
PermitApps []string `yaml:"permit-applications,omitempty" json:"permit-applications,omitempty"`
AppInfo []*AppInfo `yaml:"applications-information,omitempty" json:"applications-information,omitempty"`
visited bool
modified bool
Name string `yaml:"name,omitempty" json:"name,omitempty"`
SliceId *SliceId `yaml:"slice-id,omitempty" json:"slice-id,omitempty"`
Qos *QosInfo `yaml:"qos,omitempty" json:"qos,omitempty"`
DevGroups []string `yaml:"site-device-group,omitempty" json:"site-device-group,omitempty"`
SiteInfo *SiteInfo `yaml:"site-info,omitempty" json:"site-info,omitempty"`
ApplicationFilteringRules []*ApplicationFilteringRules `yaml:"application-filtering-rules,omitempty" json:"application-filtering-rules,omitempty"`
DenyApps []string `yaml:"deny-applications,omitempty" json:"deny-applications,omitempty"`
PermitApps []string `yaml:"permit-applications,omitempty" json:"permit-applications,omitempty"`
AppInfo []*AppInfo `yaml:"applications-information,omitempty" json:"applications-information,omitempty"`
visited bool
modified bool
}

type SliceId struct {
Expand Down Expand Up @@ -128,6 +129,27 @@ type AppInfo struct {
StartPort int `yaml:"start-port,omitempty" json:"start-port,omitempty"`
}

type ApplicationFilteringRules struct {
// Rule name
RuleName string `yaml:"rule-name,omitempty" json:"rule-name,omitempty"`
//priority
Priority int32 `yaml:"priority,omitempty" json:"priority,omitempty"`
//action
Action string `yaml:"action,omitempty" json:"action,omitempty"`
// Application Desination IP or network
Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty"`
//protocol
Protocol int32 `yaml:"protocol,omitempty" json:"protocol,omitempty"`
// port range start
StartPort int32 `yaml:"start-port,omitempty" json:"start-port,omitempty"`
// port range end
EndPort int32 `yaml:"end-port,omitempty" json:"end-port,omitempty"`

AppMbrUplink int32 `yaml:"app-mbr-uplink,omitempty" json:"app-mbr-uplink,omitempty"`

AppMbrDownlink int32 `yaml:"app-mbr-downlink,omitempty" json:"app-mbr-downlink,omitempty"`
}

const (
add_op = iota
modify_op
Expand Down

0 comments on commit 948f06b

Please sign in to comment.