fpm.proto 3.2 KB

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