Jian Li | 841a8b9 | 2017-11-23 01:31:22 +0900 | [diff] [blame] | 1 | /* |
| 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 Wang | cfffbaa | 2017-05-06 16:11:08 +0800 | [diff] [blame] | 16 | syntax="proto3"; |
| 17 | option java_package = "org.onosproject.grpc.nb.net.host"; |
| 18 | |
| 19 | package nb.net.host; |
| 20 | |
| 21 | import "net/HostProto.proto"; |
| 22 | import "net/HostIdProto.proto"; |
| 23 | import "net/ConnectPointProto.proto"; |
| 24 | |
| 25 | message getHostCountRequest { |
| 26 | } |
| 27 | |
| 28 | message getHostCountReply { |
| 29 | int32 host_count = 1; |
| 30 | } |
| 31 | |
| 32 | message getHostsRequest { |
| 33 | } |
| 34 | |
| 35 | message getHostsReply { |
| 36 | repeated .net.HostProto host = 1; |
| 37 | } |
| 38 | |
| 39 | message getHostRequest { |
| 40 | .net.HostIdProto host_id = 1; |
| 41 | } |
| 42 | |
| 43 | message getHostReply { |
| 44 | .net.HostProto host = 1; |
| 45 | } |
| 46 | |
| 47 | message getHostsByVlanRequest { |
| 48 | string vlan_id = 1; |
| 49 | } |
| 50 | |
| 51 | message getHostsByVlanReply { |
| 52 | repeated .net.HostProto host = 1; |
| 53 | } |
| 54 | |
| 55 | message getHostsByMacRequest { |
| 56 | string mac = 1; |
| 57 | } |
| 58 | |
| 59 | message getHostsByMacReply { |
| 60 | repeated .net.HostProto host = 1; |
| 61 | } |
| 62 | |
| 63 | message getHostsByIpRequest { |
| 64 | string ip_address = 1; |
| 65 | } |
| 66 | |
| 67 | message getHostsByIpReply { |
| 68 | repeated .net.HostProto host = 1; |
| 69 | } |
| 70 | |
| 71 | message getConnectedHostsRequest { |
| 72 | oneof connected_host { |
| 73 | .net.ConnectPointProto connect_point = 1; |
| 74 | string deviceId = 2; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | message getConnectedHostsReply { |
| 79 | repeated .net.HostProto host = 1; |
| 80 | } |
| 81 | |
| 82 | message startMonitoringIpRequest { |
| 83 | string ip_address = 1; |
| 84 | } |
| 85 | |
| 86 | message startMonitoringIpReply { |
| 87 | } |
| 88 | |
| 89 | message stopMonitoringIpRequest { |
| 90 | string ip_address = 1; |
| 91 | } |
| 92 | |
| 93 | message stopMonitoringIpReply { |
| 94 | } |
| 95 | |
| 96 | message requestMacRequest { |
| 97 | string ip_address = 1; |
| 98 | } |
| 99 | |
| 100 | message requestMacReply { |
| 101 | } |
| 102 | |
| 103 | // Host Interface exported by the server. |
| 104 | service 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 | } |