qpb.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * qpb.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 Quagga Protobuf component.
  53. */
  54. package qpb;
  55. enum AddressFamily {
  56. UNKNOWN_AF = 0;
  57. IPV4 = 1; // IP version 4
  58. IPV6 = 2; // IP version 6
  59. };
  60. enum SubAddressFamily {
  61. UNKNOWN_SAF = 0;
  62. UNICAST = 1;
  63. MULTICAST = 2;
  64. };
  65. //
  66. // An IP version 4 address, such as 10.1.1.1.
  67. //
  68. message Ipv4Address {
  69. required fixed32 value = 1 ;
  70. };
  71. message Ipv6Address {
  72. // 16 bytes.
  73. required bytes bytes = 1;
  74. };
  75. //
  76. // An IP version 4 or IP version 6 address.
  77. //
  78. message L3Address {
  79. optional Ipv4Address v4 = 1;
  80. optional Ipv6Address v6 = 2;
  81. };
  82. //
  83. // An IP prefix, such as 10.1/16.
  84. // We use the message below to represent both IPv4 and IPv6 prefixes.
  85. message L3Prefix {
  86. required uint32 length = 1;
  87. required bytes bytes = 2;
  88. };
  89. //
  90. // Something that identifies an interface on a machine. It can either
  91. // be a name (for instance, 'eth0') or a number currently.
  92. //
  93. message IfIdentifier {
  94. optional uint32 index = 1;
  95. optional string name = 2;
  96. };
  97. enum Protocol {
  98. UNKNOWN_PROTO = 0;
  99. LOCAL = 1;
  100. CONNECTED = 2;
  101. KERNEL = 3;
  102. STATIC = 4;
  103. RIP = 5;
  104. RIPNG = 6;
  105. OSPF = 7;
  106. ISIS = 8;
  107. BGP = 9;
  108. OTHER = 10;
  109. }