Skip to content

Commit 50f0d4d

Browse files
sustrikjuagargi
authored andcommitted
gateway: etags added to prefix discovery protobuf (scionproto#4461)
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.
1 parent fdb98af commit 50f0d4d

File tree

2 files changed

+51
-22
lines changed

2 files changed

+51
-22
lines changed

pkg/proto/gateway/prefix.pb.go

Lines changed: 39 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gateway/v1/prefix.proto

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,22 @@ service IPPrefixesService {
2323
rpc Prefixes(PrefixesRequest) returns (PrefixesResponse) {}
2424
}
2525

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

2834
message PrefixesResponse {
2935
// Prefixes are the prefixes that are reachable via the Gateway that
30-
// responds.
36+
// responds. If the etag in the request is the same as the etag in
37+
// the response this field must be empty.
3138
repeated Prefix prefixes = 1;
39+
// Etag is the hash of the returned prefix set. The servers that don't
40+
// support etags must return an empty string in this field.
41+
string etag = 2;
3242
}
3343

3444
message Prefix {

0 commit comments

Comments
 (0)