Avneesh Sachdev | ef20ef7 | 2016-04-04 10:54:57 -0700 | [diff] [blame^] | 1 | // |
| 2 | // fpm.proto |
| 3 | // |
| 4 | // @copyright Copyright (C) 2016 Sproute Networks, Inc. |
| 5 | // |
| 6 | // @author Avneesh Sachdev <avneesh@sproute.com> |
| 7 | // |
| 8 | // Permission is granted to use, copy, modify and/or distribute this |
| 9 | // software under either one of the licenses below. |
| 10 | // |
| 11 | // Note that if you use other files from the Quagga tree directly or |
| 12 | // indirectly, then the licenses in those files still apply. |
| 13 | // |
| 14 | // Please retain both licenses below when modifying this code in the |
| 15 | // Quagga tree. |
| 16 | // |
| 17 | |
| 18 | // |
| 19 | // License Option 1: GPL |
| 20 | // |
| 21 | // This program is free software; you can redistribute it and/or modify it |
| 22 | // under the terms of the GNU General Public License as published by the Free |
| 23 | // Software Foundation; either version 2 of the License, or (at your option) |
| 24 | // any later version. |
| 25 | // |
| 26 | // This program is distributed in the hope that it will be useful,but WITHOUT |
| 27 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 28 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 29 | // more details. |
| 30 | // |
| 31 | // You should have received a copy of the GNU General Public License along |
| 32 | // with this program; if not, write to the Free Software Foundation, Inc., |
| 33 | // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 34 | // |
| 35 | |
| 36 | // |
| 37 | // License Option 2: ISC License |
| 38 | // |
| 39 | // Permission to use, copy, modify, and/or distribute this software |
| 40 | // for any purpose with or without fee is hereby granted, provided |
| 41 | // that the above copyright notice and this permission notice appear |
| 42 | // in all copies. |
| 43 | // |
| 44 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 45 | // WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 46 | // WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 47 | // AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR |
| 48 | // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS |
| 49 | // OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
| 50 | // NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
| 51 | // CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 52 | // |
| 53 | |
| 54 | // |
| 55 | // Protobuf definitions pertaining to the Forwarding Plane Manager component. |
| 56 | // |
| 57 | |
| 58 | package fpm; |
| 59 | |
| 60 | import "qpb/qpb.proto"; |
| 61 | |
| 62 | // |
| 63 | // A Nexthop for a route. It indicates how packets to a given prefix |
| 64 | // should be forwarded (for instance, send them out of a specified |
| 65 | // interface to a specified address). |
| 66 | // |
| 67 | message Nexthop { |
| 68 | optional qpb.IfIdentifier if_id = 2; |
| 69 | optional qpb.L3Address address = 3; |
| 70 | } |
| 71 | |
| 72 | message RouteKey { |
| 73 | optional qpb.L3Prefix prefix = 1; |
| 74 | } |
| 75 | |
| 76 | message DeleteRoute { |
| 77 | required uint32 vrf_id = 1; |
| 78 | required qpb.AddressFamily address_family = 2; |
| 79 | required qpb.SubAddressFamily sub_address_family = 3; |
| 80 | required RouteKey key = 4; |
| 81 | } |
| 82 | |
| 83 | enum RouteType { |
| 84 | UNKNOWN = 0; |
| 85 | NORMAL = 1; |
| 86 | UNREACHABLE = 2; |
| 87 | BLACKHOLE = 3; |
| 88 | } |
| 89 | |
| 90 | message AddRoute { |
| 91 | required uint32 vrf_id = 1; |
| 92 | required qpb.AddressFamily address_family = 2; |
| 93 | required qpb.SubAddressFamily sub_address_family = 3; |
| 94 | required RouteKey key = 4; |
| 95 | |
| 96 | optional RouteType route_type = 5; |
| 97 | |
| 98 | required qpb.Protocol protocol = 6; |
| 99 | |
| 100 | required int32 metric = 8; |
| 101 | |
| 102 | repeated Nexthop nexthops = 9; |
| 103 | } |
| 104 | |
| 105 | // |
| 106 | // Any message from the FPM. |
| 107 | // |
| 108 | message Message { |
| 109 | enum Type { |
| 110 | UNKNOWN_MSG = 0; |
| 111 | ADD_ROUTE = 1; |
| 112 | DELETE_ROUTE = 2; |
| 113 | }; |
| 114 | |
| 115 | optional Type type = 1; |
| 116 | |
| 117 | optional AddRoute add_route = 2; |
| 118 | optional DeleteRoute delete_route = 3; |
| 119 | } |