Skip to content

Commit

Permalink
Enable multiple src/dst IP addresses in Connection Context.
Browse files Browse the repository at this point in the history
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
  • Loading branch information
edwarnicke committed Oct 1, 2020
1 parent 93ee44c commit 817aafc
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 59 deletions.
110 changes: 55 additions & 55 deletions pkg/api/networkservice/connectioncontext.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/api/networkservice/connectioncontext.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ message ExtraPrefixRequest {
}

message IPContext {
string src_ip_addr = 1; /* source ip address + prefix in format <address>/<prefix> */
string dst_ip_addr = 2; /* destination ip address + prefix in format <address>/<prefix> */
repeated string src_ip_addr = 1; /* source ip address + prefix in format <address>/<prefix> */
repeated string dst_ip_addr = 2; /* destination ip address + prefix in format <address>/<prefix> */

bool src_ip_required = 3; /* if specified src_ip is required from NSE. */
bool dst_ip_required = 4; /* if specified dst_ip is required from NSE */
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/networkservice/connectioncontext_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func (c *ConnectionContext) MeetsRequirements(original *ConnectionContext) error
if err != nil {
return err
}
if original.GetIpContext().GetDstIpRequired() && c.GetIpContext().GetDstIpAddr() == "" {
if original.GetIpContext().GetDstIpRequired() && len(c.GetIpContext().GetDstIpAddr()) > 0 {
return errors.Errorf("ConnectionContext.DestIp is required and cannot be empty/nil: %v", c)
}
if original.GetIpContext().GetSrcIpRequired() && c.GetIpContext().GetSrcIpAddr() == "" {
if original.GetIpContext().GetSrcIpRequired() && len(c.GetIpContext().GetSrcIpAddr()) > 0 {
return errors.Errorf("ConnectionContext.SrcIp is required cannot be empty/nil: %v", c)
}

Expand Down

0 comments on commit 817aafc

Please sign in to comment.