syntax = "proto3"; package proto; import "google/protobuf/empty.proto"; // The Init service definition. service Networkd { rpc Routes(google.protobuf.Empty) returns (RoutesReply) {} rpc Interfaces(google.protobuf.Empty) returns(InterfacesReply) {} } enum AddressFamily { option allow_alias = true; AF_UNSPEC = 0x0; AF_INET = 0x2; IPV4 = 0x2; AF_INET6 = 0xa; IPV6 = 0xa; } enum RouteProtocol { RTPROT_UNSPEC = 0; RTPROT_REDIRECT = 1; // Route installed by ICMP redirects RTPROT_KERNEL = 2; // Route installed by kernel RTPROT_BOOT = 3; // Route installed during boot RTPROT_STATIC = 4; // Route installed by administrator RTPROT_GATED = 8; // Route installed by gated RTPROT_RA = 9; // Route installed by router advertisement RTPROT_MRT = 10; // Route installed by Merit MRT RTPROT_ZEBRA = 11; // Route installed by Zebra/Quagga RTPROT_BIRD = 12; // Route installed by Bird RTPROT_DNROUTED = 13; // Route installed by DECnet routing daemon RTPROT_XORP = 14; // Route installed by XORP RTPROT_NTK = 15; // Route installed by Netsukuku RTPROT_DHCP = 16; // Route installed by DHCP RTPROT_MROUTED = 17; // Route installed by Multicast daemon RTPROT_BABEL = 42; // Route installed by Babel daemon } enum InterfaceFlags { FlagUnknown = 0; FlagUp = 1; FlagBroadcast = 2; FlagLoopback = 3; FlagPointToPoint = 4; FlagMulticast = 5; } // The response message containing the routes. message RoutesReply { repeated Route routes = 1; } // The response message containing a route. message Route { // Interface is the interface over which traffic to this destination should be sent string interface = 1; // Destination is the network prefix CIDR which this route provides string destination = 2; // Gateway is the gateway address to which traffic to this destination should be sent string gateway = 3; // Metric is the priority of the route, where lower metrics have higher priorities uint32 metric = 4; // Scope desribes the scope of this route uint32 scope = 5; // Source is the source prefix CIDR for the route, if one is defined string source = 6; // Family is the address family of the route. Currently, the only options are AF_INET (IPV4) and AF_INET6 (IPV6). AddressFamily family = 7; // Protocol is the protocol by which this route came to be in place RouteProtocol protocol = 8; // Flags indicate any special flags on the route uint32 flags = 9; } message InterfacesReply { repeated Interface interfaces = 1; } // Interface represents a net.Interface message Interface { uint32 index = 1; uint32 mtu = 2; string name = 3; string hardwareaddr = 4; InterfaceFlags flags = 5; repeated string ipaddress = 6; }