blob: 56f2577a791b7facc282127d94a07e5ed9120f2e [file] [log] [blame]
Jian Li841a8b92017-11-23 01:31:22 +09001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Frank Wangcfffbaa2017-05-06 16:11:08 +080016syntax="proto3";
17option java_package = "org.onosproject.grpc.nb.net.host";
18
19package nb.net.host;
20
21import "net/HostProto.proto";
22import "net/HostIdProto.proto";
23import "net/ConnectPointProto.proto";
24
25message getHostCountRequest {
26}
27
28message getHostCountReply {
29 int32 host_count = 1;
30}
31
32message getHostsRequest {
33}
34
35message getHostsReply {
36 repeated .net.HostProto host = 1;
37}
38
39message getHostRequest {
40 .net.HostIdProto host_id = 1;
41}
42
43message getHostReply {
44 .net.HostProto host = 1;
45}
46
47message getHostsByVlanRequest {
48 string vlan_id = 1;
49}
50
51message getHostsByVlanReply {
52 repeated .net.HostProto host = 1;
53}
54
55message getHostsByMacRequest {
56 string mac = 1;
57}
58
59message getHostsByMacReply {
60 repeated .net.HostProto host = 1;
61}
62
63message getHostsByIpRequest {
64 string ip_address = 1;
65}
66
67message getHostsByIpReply {
68 repeated .net.HostProto host = 1;
69}
70
71message getConnectedHostsRequest {
72 oneof connected_host {
73 .net.ConnectPointProto connect_point = 1;
74 string deviceId = 2;
75 }
76}
77
78message getConnectedHostsReply {
79 repeated .net.HostProto host = 1;
80}
81
82message startMonitoringIpRequest {
83 string ip_address = 1;
84}
85
86message startMonitoringIpReply {
87}
88
89message stopMonitoringIpRequest {
90 string ip_address = 1;
91}
92
93message stopMonitoringIpReply {
94}
95
96message requestMacRequest {
97 string ip_address = 1;
98}
99
100message requestMacReply {
101}
102
103// Host Interface exported by the server.
104service HostService {
105 // GRPC Obtains the host count.
106 rpc getHostCount(getHostCountRequest) returns (getHostCountReply) {}
107
108 // GRPC Obtains the hosts.
109 rpc getHosts(getHostsRequest) returns (getHostsReply) {}
110
111 // GRPC Obtains the host at a given HostId.
112 rpc getHost(getHostRequest) returns (getHostReply) {}
113
114 // GRPC Obtains the hosts at a given VlanId.
115 rpc getHostsByVlan(getHostsByVlanRequest) returns (getHostsByVlanReply) {}
116
117 // GRPC Obtains the hosts at a given MacAddress.
118 rpc getHostsByMac(getHostsByMacRequest) returns (getHostsByMacReply) {}
119
120 // GRPC Obtains the hosts at a given IpAddress.
121 rpc getHostsByIp(getHostsByIpRequest) returns (getHostsByIpReply) {}
122
123 // GRPC Obtains the hosts at a given connectPoint or DeviceId.
124 rpc getConnectedHosts(getConnectedHostsRequest) returns (getConnectedHostsReply) {}
125
126 // GRPC Requests the host service to monitor hosts with the given IP address.
127 rpc startMonitoringIp(startMonitoringIpRequest) returns (startMonitoringIpReply) {}
128
129 // GRPC Stops the host service from monitoring an IP address.
130 rpc stopMonitoringIp(stopMonitoringIpRequest) returns (stopMonitoringIpReply) {}
131
132 // GRPC Requests the host service to resolve the MAC address for the given IP address.
133 rpc requestMac(requestMacRequest) returns (requestMacReply) {}
134}