Skip to content

Commit

Permalink
gateway: etags added to prefix discovery protobuf (scionproto#4461)
Browse files Browse the repository at this point in the history
Etags can be used so as not to transfer large prefix sets over and over
again.

Etags may or may not be supported by a particular gateway
implementation. This change is fully forward and backward compatible.
Implementations that do not support etags should just ignore the field.
  • Loading branch information
sustrik authored and juagargi committed Mar 8, 2024
1 parent fdb98af commit 50f0d4d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 22 deletions.
59 changes: 39 additions & 20 deletions pkg/proto/gateway/prefix.pb.go

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

14 changes: 12 additions & 2 deletions proto/gateway/v1/prefix.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,22 @@ service IPPrefixesService {
rpc Prefixes(PrefixesRequest) returns (PrefixesResponse) {}
}

message PrefixesRequest {}
message PrefixesRequest {
// Etag is the hash of the prefix set currently used by the requester.
// This value must not be calculated by the client. Instead it should
// be copied from the previous response. If there was no previous response
// set this field to empty string.
string etag = 1;
}

message PrefixesResponse {
// Prefixes are the prefixes that are reachable via the Gateway that
// responds.
// responds. If the etag in the request is the same as the etag in
// the response this field must be empty.
repeated Prefix prefixes = 1;
// Etag is the hash of the returned prefix set. The servers that don't
// support etags must return an empty string in this field.
string etag = 2;
}

message Prefix {
Expand Down

0 comments on commit 50f0d4d

Please sign in to comment.