blob: ce84b48773f416abfd2126887e5e31a8d6591247 [file] [log] [blame]
Sergiusz Bazanskie653e6a2019-07-20 16:36:00 +02001syntax = "proto3";
2package ix;
3
4message GetIXMembersRequest {
5 // IX ID from PeeringDB
6 int64 id = 1;
7}
8
Sergiusz Bazanski0607aba2019-08-02 13:38:22 +02009message PeeringDBMember {
10 int64 asn = 1;
11 // AS/network name.
12 string name = 2;
13
14 message Router {
15 // Per PeeringDB, at least one of the following two address families
16 // will be set.
17 string ipv4 = 1;
18 string ipv6 = 2;
19 }
20 repeated Router routers = 3;
21}
22
23
Sergiusz Bazanskie653e6a2019-07-20 16:36:00 +020024message GetIXMembersResponse {
25 message Member {
26 int64 asn = 1;
27 // Per PeeringDB, at least one of the following two address families
28 // will be set.
29 string ipv4 = 2;
30 string ipv6 = 3;
31 // AS/network name.
32 string name = 4;
33 };
34
35 repeated Member members = 1;
36}
37
38service PeeringDBProxy {
39 // GetIXMembers returns information about membership of a given PeeringDB IX.
40 rpc GetIXMembers(GetIXMembersRequest) returns (GetIXMembersResponse);
41}
Sergiusz Bazanski6eaaaf92019-08-02 01:25:31 +020042
43message IRRQueryRequest {
44 // AS to query for. This needs be the AS number of the AS, possibly
45 // prefixed with 'as'/'AS'.
46 string as = 1;
47}
48
49message IRRAttribute {
50 message ImportExport {
51 message Expression {
52 string peering = 1;
53 string router_us = 2;
54 string router_them = 3;
55 repeated string actions = 4;
56 }
57 string protocol_from = 1;
58 string protocol_into = 2;
59 repeated Expression expressions = 3;
60 string filter = 4;
61 }
62
63 oneof value {
64 string remarks = 1;
65 ImportExport import = 2;
66 ImportExport export = 3;
67 }
68}
69
70message IRRQueryResponse {
71 enum Source {
72 SOURCE_INVALID = 0;
73 SOURCE_RIPE = 1;
74 SOURCE_ARIN = 2;
75 }
76 Source source = 1;
77 repeated IRRAttribute attributes = 2;
78}
79
80service IRR {
81 // Query returns parsed RPSL data from supported IRRs for a given aut-num.
82 rpc Query(IRRQueryRequest) returns (IRRQueryResponse);
83}
Sergiusz Bazanski0e223ec2019-07-23 00:53:50 +020084
85message KeyInfoRequest {
86 // Public key fingerprint. 20 bytes.
87 bytes fingerprint = 1;
88 enum Caching {
89 CACHING_INVALID = 0;
90 // Contact keyservers only if not locally (positively or negatively) cached.
91 CACHING_AUTO = 1;
92 // Force contacting keyservers.
93 CACHING_FORCE_REMOTE = 2;
94 // Force not contacting keyservers.
95 CACHING_FORCE_LOCAL = 3;
96 };
97 Caching caching = 2;
98}
99
100message KeyInfoResponse {
101 // Currently no data is returned. An error will be returned if the key doesn't exist.
102}
103
104message EncryptRequest {
105 // A chunk of plaintext data. Small enough to fit in gRPC message (<<2 MiB).
106 bytes data = 1;
107 enum ChunkInfo {
108 CHUNK_INFO_INVALID = 0;
109 // More data to come after this chunked.
110 CHUNK_INFO_MORE = 1;
111 // Last chunk.
112 CHUNK_LAST = 2;
113 };
114 ChunkInfo info = 2;
115 // Fingerprint of key to encrypt with. Only the first chunk is consulted,
116 // the key in the rest of the chunks are ignored. 20 bytes.
117 bytes fingerprint = 3;
118}
119
120message EncryptResponse {
121 // A chunk of encrypted data. Small enough to fit in gRPC message (<<2 MiB).
122 bytes data = 1;
123 enum ChunkInfo {
124 CHUNK_INFO_INVALID = 0;
125 // More data to come after this chunked.
126 CHUNK_INFO_MORE = 1;
127 // Last chunk.
128 CHUNK_LAST = 2;
129 };
130 ChunkInfo info = 2;
131}
132
133service PGPEncryptor {
134 // KeyInfo returns information about a given key from the public keyserver infrastructure.
135 // If key doesn't exist, error (NotFound).
136 rpc KeyInfo(KeyInfoRequest) returns (KeyInfoResponse);
137 // Encrypt encrypts a given data blob with a given key from public keyserver infrastructure.
138 // If key doesn't exist, error (NotFound).
139 rpc Encrypt(stream EncryptRequest) returns (stream EncryptResponse);
140}