Skip to content

Commit

Permalink
API for GRE (#1445)
Browse files Browse the repository at this point in the history
* Add GRE VPP calls. Add GRE type and link to inteface message

* add basic validation and support of create and delete operations for GRE

* Rename things. Store addresses as net.IP

* add GRE to interfaces dump

* Add UNKNOWN to types of GRE tunnel

* Support vpp1901 and vpp1908

* Test also removing of GRE tunnel
  • Loading branch information
rewenset authored and ondrej-fabry committed Sep 2, 2019
1 parent d81386e commit 3814f0f
Show file tree
Hide file tree
Showing 18 changed files with 1,888 additions and 121 deletions.
390 changes: 269 additions & 121 deletions api/models/vpp/interfaces/interface.pb.go

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions api/models/vpp/interfaces/interface.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ message Interface {
IPSEC_TUNNEL = 8;
VMXNET3_INTERFACE = 9;
BOND_INTERFACE = 10;
GRE_TUNNEL = 11;
};

// Name is mandatory field representing logical name for the interface.
Expand Down Expand Up @@ -97,6 +98,7 @@ message Interface {
IPSecLink ipsec = 105;
VmxNet3Link vmx_net3 = 106;
BondLink bond = 107;
GreLink gre = 108;
};
};

Expand Down Expand Up @@ -226,3 +228,17 @@ message BondLink {
}
repeated BondedInterface bonded_interfaces = 12;
}

message GreLink {
enum Type {
UNKNOWN = 0;
L3 = 1; // L3 GRE (i.e. this tunnel is in L3 mode)
TEB = 2; // Transparent Ethernet Bridging - the tunnel is in L2 mode
ERSPAN = 3; // ERSPAN - the tunnel is for port mirror SPAN output
};
Type tunnel_type = 1;
string src_addr = 2;
string dst_addr = 3;
uint32 outer_fib_id = 4;
uint32 session_id = 5;
}
1 change: 1 addition & 0 deletions plugins/vpp/binapi/vpp1901/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package vpp1901
//go:generate binapi-generator --input-file=/usr/share/vpp/api/bfd.api.json
//go:generate binapi-generator --input-file=/usr/share/vpp/api/bond.api.json
//go:generate binapi-generator --input-file=/usr/share/vpp/api/dhcp.api.json
//go:generate binapi-generator --input-file=/usr/share/vpp/api/gre.api.json
//go:generate binapi-generator --input-file=/usr/share/vpp/api/interface.api.json
//go:generate binapi-generator --input-file=/usr/share/vpp/api/ip.api.json
//go:generate binapi-generator --input-file=/usr/share/vpp/api/ipsec.api.json
Expand Down
182 changes: 182 additions & 0 deletions plugins/vpp/binapi/vpp1901/gre/gre.ba.go

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

1 change: 1 addition & 0 deletions plugins/vpp/binapi/vpp1904/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package vpp1904
//go:generate binapigen --input-file=/usr/share/vpp/api/core/bfd.api.json
//go:generate binapigen --input-file=/usr/share/vpp/api/core/bond.api.json
//go:generate binapigen --input-file=/usr/share/vpp/api/core/dhcp.api.json
//go:generate binapigen --input-file=/usr/share/vpp/api/core/gre.api.json
//go:generate binapigen --input-file=/usr/share/vpp/api/core/interface.api.json
//go:generate binapigen --input-file=/usr/share/vpp/api/core/ip.api.json
//go:generate binapigen --input-file=/usr/share/vpp/api/core/ipsec.api.json
Expand Down
Loading

0 comments on commit 3814f0f

Please sign in to comment.