Skip to content

Commit

Permalink
clean up FQDNCapability message
Browse files Browse the repository at this point in the history
- we don't need hostlen and domainlen.
- use camel case.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
  • Loading branch information
fujita committed Jan 16, 2022
1 parent 5057add commit 229d116
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 60 deletions.
75 changes: 27 additions & 48 deletions api/capability.pb.go

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

8 changes: 3 additions & 5 deletions api/capability.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ message LongLivedGracefulRestartCapability {
message RouteRefreshCiscoCapability {
}

message FQDNCapability {
uint32 host_name_len = 1;
string host_name = 2;
uint32 domain_name_len = 3;
string domain_name = 4;
message FqdnCapability {
string host_name = 1;
string domain_name = 2;
}

message UnknownCapability {
Expand Down
12 changes: 5 additions & 7 deletions pkg/apiutil/capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,10 @@ func NewRouteRefreshCiscoCapability(a *bgp.CapRouteRefreshCisco) *api.RouteRefre
return &api.RouteRefreshCiscoCapability{}
}

func NewFQDNCapability(a *bgp.CapFQDN) *api.FQDNCapability {
return &api.FQDNCapability{
HostNameLen: uint32(a.HostNameLen),
HostName: a.HostName,
DomainNameLen: uint32(a.DomainNameLen),
DomainName: a.DomainName,
func NewFQDNCapability(a *bgp.CapFQDN) *api.FqdnCapability {
return &api.FqdnCapability{
HostName: a.HostName,
DomainName: a.DomainName,
}
}

Expand Down Expand Up @@ -237,7 +235,7 @@ func unmarshalCapability(a *apb.Any) (bgp.ParameterCapabilityInterface, error) {
return bgp.NewCapLongLivedGracefulRestart(tuples), nil
case *api.RouteRefreshCiscoCapability:
return bgp.NewCapRouteRefreshCisco(), nil
case *api.FQDNCapability:
case *api.FqdnCapability:
return bgp.NewCapFQDN(a.HostName, a.DomainName), nil
case *api.UnknownCapability:
return bgp.NewCapUnknown(bgp.BGPCapabilityCode(a.Code), a.Value), nil
Expand Down

0 comments on commit 229d116

Please sign in to comment.