github.com/osrg/gobgp@v2.0.0+incompatible/api/attribute.proto (about)

     1  // Copyright (C) 2018 Nippon Telegraph and Telephone Corporation.
     2  //
     3  // Permission is hereby granted, free of charge, to any person
     4  // obtaining a copy of this software and associated documentation files
     5  // (the "Software"), to deal in the Software without restriction,
     6  // including without limitation the rights to use, copy, modify, merge,
     7  // publish, distribute, sublicense, and/or sell copies of the Software,
     8  // and to permit persons to whom the Software is furnished to do so,
     9  // subject to the following conditions:
    10  //
    11  // The above copyright notice and this permission notice shall be
    12  // included in all copies or substantial portions of the Software.
    13  
    14  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    15  // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    16  // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    17  // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    18  // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    19  // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    20  // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    21  
    22  syntax = "proto3";
    23  
    24  import "google/protobuf/any.proto";
    25  import "gobgp.proto";
    26  
    27  package gobgpapi;
    28  
    29  message OriginAttribute {
    30      uint32 origin = 1;
    31  }
    32  
    33  message AsSegment {
    34      uint32 type = 1;
    35      repeated uint32 numbers = 2;
    36  }
    37  
    38  message AsPathAttribute {
    39      repeated AsSegment segments = 1;
    40  }
    41  
    42  message NextHopAttribute {
    43      string next_hop = 1;
    44  }
    45  
    46  message MultiExitDiscAttribute {
    47      uint32 med = 1;
    48  }
    49  
    50  message LocalPrefAttribute {
    51      uint32 local_pref = 1;
    52  }
    53  
    54  message AtomicAggregateAttribute {
    55  }
    56  
    57  message AggregatorAttribute {
    58      uint32 as = 2;
    59      string address = 3;
    60  }
    61  
    62  message CommunitiesAttribute {
    63      repeated uint32 communities = 1;
    64  }
    65  
    66  message OriginatorIdAttribute {
    67      string id = 1;
    68  }
    69  
    70  message ClusterListAttribute {
    71      repeated string ids = 1;
    72  }
    73  
    74  // IPAddressPrefix represents the NLRI for:
    75  // - AFI=1, SAFI=1
    76  // - AFI=2, SAFI=1
    77  message IPAddressPrefix {
    78      uint32 prefix_len = 1;
    79      string prefix = 2;
    80  }
    81  
    82  // LabeledIPAddressPrefix represents the NLRI for:
    83  // - AFI=1, SAFI=4
    84  // - AFI=2, SAFI=4
    85  message LabeledIPAddressPrefix {
    86      repeated uint32 labels = 1;
    87      uint32 prefix_len = 2;
    88      string prefix = 3;
    89  }
    90  
    91  // EncapsulationNLRI represents the NLRI for:
    92  // - AFI=1, SAFI=7
    93  // - AFI=2, SAFI=7
    94  message EncapsulationNLRI {
    95      string address = 1;
    96  }
    97  
    98  message RouteDistinguisherTwoOctetAS {
    99      uint32 admin = 1;
   100      uint32 assigned = 2;
   101  }
   102  
   103  message RouteDistinguisherIPAddress {
   104      string admin = 1;
   105      uint32 assigned = 2;
   106  }
   107  
   108  message RouteDistinguisherFourOctetAS {
   109      uint32 admin = 1;
   110      uint32 assigned = 2;
   111  }
   112  
   113  message EthernetSegmentIdentifier {
   114      uint32 type = 1;
   115      bytes value = 2;
   116  }
   117  
   118  // EVPNEthernetAutoDiscoveryRoute represents the NLRI for:
   119  // - AFI=25, SAFI=70, RouteType=1
   120  message EVPNEthernetAutoDiscoveryRoute {
   121      // One of:
   122      // - RouteDistinguisherTwoOctetAS
   123      // - RouteDistinguisherIPAddressAS
   124      // - RouteDistinguisherFourOctetAS
   125      google.protobuf.Any rd = 1;
   126      EthernetSegmentIdentifier esi = 2;
   127      uint32 ethernet_tag = 3;
   128      uint32 label = 4;
   129  }
   130  
   131  // EVPNMACIPAdvertisementRoute represents the NLRI for:
   132  // - AFI=25, SAFI=70, RouteType=2
   133  message EVPNMACIPAdvertisementRoute {
   134      // One of:
   135      // - RouteDistinguisherTwoOctetAS
   136      // - RouteDistinguisherIPAddressAS
   137      // - RouteDistinguisherFourOctetAS
   138      google.protobuf.Any rd = 1;
   139      EthernetSegmentIdentifier esi = 2;
   140      uint32 ethernet_tag = 3;
   141      string mac_address = 4;
   142      string ip_address = 5;
   143      repeated uint32 labels = 6;
   144  }
   145  
   146  // EVPNInclusiveMulticastEthernetTagRoute represents the NLRI for:
   147  // - AFI=25, SAFI=70, RouteType=3
   148  message EVPNInclusiveMulticastEthernetTagRoute {
   149      // One of:
   150      // - RouteDistinguisherTwoOctetAS
   151      // - RouteDistinguisherIPAddressAS
   152      // - RouteDistinguisherFourOctetAS
   153      google.protobuf.Any rd = 1;
   154      uint32 ethernet_tag = 2;
   155      string ip_address = 3;
   156  }
   157  
   158  // EVPNEthernetSegmentRoute represents the NLRI for:
   159  // - AFI=25, SAFI=70, RouteType=4
   160  message EVPNEthernetSegmentRoute {
   161      // One of:
   162      // - RouteDistinguisherTwoOctetAS
   163      // - RouteDistinguisherIPAddressAS
   164      // - RouteDistinguisherFourOctetAS
   165      google.protobuf.Any rd = 1;
   166      EthernetSegmentIdentifier esi = 2;
   167      string ip_address = 3;
   168  }
   169  
   170  // EVPNIPPrefixRoute represents the NLRI for:
   171  // - AFI=25, SAFI=70, RouteType=5
   172  message EVPNIPPrefixRoute {
   173      // One of:
   174      // - RouteDistinguisherTwoOctetAS
   175      // - RouteDistinguisherIPAddressAS
   176      // - RouteDistinguisherFourOctetAS
   177      google.protobuf.Any rd = 1;
   178      EthernetSegmentIdentifier esi = 2;
   179      uint32 ethernet_tag = 3;
   180      string ip_prefix = 4;
   181      uint32 ip_prefix_len = 5;
   182      string gw_address = 6;
   183      uint32 label = 7;
   184  }
   185  
   186  // LabeledVPNIPAddressPrefix represents the NLRI for:
   187  // - AFI=1, SAFI=128
   188  // - AFI=2, SAFI=128
   189  message LabeledVPNIPAddressPrefix {
   190      repeated uint32 labels = 1;
   191      // One of:
   192      // - TwoOctetAsSpecificExtended
   193      // - IPv4AddressSpecificExtended
   194      // - FourOctetAsSpecificExtended
   195      google.protobuf.Any rd = 2;
   196      uint32 prefix_len = 3;
   197      string prefix = 4;
   198  }
   199  
   200  // RouteTargetMembershipNLRI represents the NLRI for:
   201  // - AFI=1, SAFI=132
   202  message RouteTargetMembershipNLRI {
   203      uint32 as = 1;
   204      // One of:
   205      // - TwoOctetAsSpecificExtended
   206      // - IPv4AddressSpecificExtended
   207      // - FourOctetAsSpecificExtended
   208      google.protobuf.Any rt = 2;
   209  }
   210  
   211  message FlowSpecIPPrefix {
   212      uint32 type = 1;
   213      uint32 prefix_len = 2;
   214      string prefix = 3;
   215      // IPv6 only
   216      uint32 offset = 4;
   217  }
   218  
   219  message FlowSpecMAC {
   220      uint32 type = 1;
   221      string address = 2;
   222  }
   223  
   224  message FlowSpecComponentItem {
   225      // Operator for Numeric type, Operand for Bitmask type
   226      uint32 op = 1;
   227      uint64 value = 2;
   228  }
   229  
   230  message FlowSpecComponent {
   231      uint32 type = 1;
   232      repeated FlowSpecComponentItem items = 2;
   233  }
   234  
   235  // FlowSpecNLRI represents the NLRI for:
   236  // - AFI=1, SAFI=133
   237  // - AFI=2, SAFI=133
   238  message FlowSpecNLRI {
   239      // One of:
   240      // - FlowSpecIPPrefix
   241      // - FlowSpecMAC
   242      // - FlowSpecComponent
   243      repeated google.protobuf.Any rules = 1;
   244  }
   245  
   246  // VPNFlowSpecNLRI represents the NLRI for:
   247  // - AFI=1, SAFI=134
   248  // - AFI=2, SAFI=134
   249  // - AFI=25, SAFI=134
   250  message VPNFlowSpecNLRI {
   251      // One of:
   252      // - RouteDistinguisherTwoOctetAS
   253      // - RouteDistinguisherIPAddressAS
   254      // - RouteDistinguisherFourOctetAS
   255      google.protobuf.Any rd = 1;
   256      // One of:
   257      // - FlowSpecIPPrefix
   258      // - FlowSpecMAC
   259      // - FlowSpecComponent
   260      repeated google.protobuf.Any rules = 2;
   261  }
   262  
   263  // OpaqueNLRI represents the NLRI for:
   264  // - AFI=16397, SAFI=241
   265  message OpaqueNLRI {
   266      bytes key = 1;
   267      bytes value = 2;
   268  }
   269  
   270  message MpReachNLRIAttribute {
   271      gobgpapi.Family family = 1;
   272      repeated string next_hops = 2;
   273      // Each NLRI must be one of:
   274      // - IPAddressPrefix
   275      // - LabeledIPAddressPrefix
   276      // - EncapsulationNLRI
   277      // - EVPNEthernetAutoDiscoveryRoute
   278      // - EVPNMACIPAdvertisementRoute
   279      // - EVPNInclusiveMulticastEthernetTagRoute
   280      // - EVPNEthernetSegmentRoute
   281      // - EVPNIPPrefixRoute
   282      // - LabeledVPNIPAddressPrefix
   283      // - RouteTargetMembershipNLRI
   284      // - FlowSpecNLRI
   285      // - VPNFlowSpecNLRI
   286      // - OpaqueNLRI
   287      repeated google.protobuf.Any nlris = 3;
   288  }
   289  
   290  message MpUnreachNLRIAttribute {
   291      gobgpapi.Family family = 1;
   292      // The same as NLRI field of MpReachNLRIAttribute
   293      repeated google.protobuf.Any nlris = 3;
   294  }
   295  
   296  message TwoOctetAsSpecificExtended {
   297      bool is_transitive = 1;
   298      uint32 sub_type = 2;
   299      uint32 as = 3;
   300      uint32 local_admin = 4;
   301  }
   302  
   303  message IPv4AddressSpecificExtended {
   304      bool is_transitive = 1;
   305      uint32 sub_type = 2;
   306      string address = 3;
   307      uint32 local_admin = 4;
   308  }
   309  
   310  message FourOctetAsSpecificExtended {
   311      bool is_transitive = 1;
   312      uint32 sub_type = 2;
   313      uint32 as = 3;
   314      uint32 local_admin = 4;
   315  }
   316  
   317  message ValidationExtended {
   318      uint32 state = 1;
   319  }
   320  
   321  message ColorExtended {
   322      uint32 color = 1;
   323  }
   324  
   325  message EncapExtended {
   326      uint32 tunnel_type = 1;
   327  }
   328  
   329  message DefaultGatewayExtended {
   330  }
   331  
   332  message OpaqueExtended {
   333      bool is_transitive = 1;
   334      bytes value = 3;
   335  }
   336  
   337  message ESILabelExtended {
   338      bool is_single_active = 1;
   339      uint32 label = 2;
   340  }
   341  
   342  message ESImportRouteTarget {
   343      string es_import = 1;
   344  }
   345  
   346  message MacMobilityExtended {
   347      bool is_sticky = 1;
   348      uint32 sequence_num = 2;
   349  }
   350  
   351  message RouterMacExtended {
   352      string mac = 1;
   353  }
   354  
   355  message TrafficRateExtended {
   356      uint32 as = 1;
   357      float rate = 2;
   358  }
   359  
   360  message TrafficActionExtended {
   361      bool terminal = 1;
   362      bool sample = 2;
   363  }
   364  
   365  message RedirectTwoOctetAsSpecificExtended {
   366      uint32 as = 1;
   367      uint32 local_admin = 2;
   368  }
   369  
   370  message RedirectIPv4AddressSpecificExtended {
   371      string address = 1;
   372      uint32 local_admin = 2;
   373  }
   374  
   375  message RedirectFourOctetAsSpecificExtended {
   376      uint32 as = 1;
   377      uint32 local_admin = 2;
   378  }
   379  
   380  message TrafficRemarkExtended {
   381      uint32 dscp = 1;
   382  }
   383  
   384  message UnknownExtended {
   385      uint32 type = 1;
   386      bytes value = 2;
   387  }
   388  
   389  message ExtendedCommunitiesAttribute {
   390      // Each Community must be one of:
   391      // - TwoOctetAsSpecificExtended
   392      // - IPv4AddressSpecificExtended
   393      // - FourOctetAsSpecificExtended
   394      // - OpaqueExtended
   395      // - ESILabelExtended
   396      // - MacMobilityExtended
   397      // - RouterMacExtended
   398      // - TrafficRateExtended
   399      // - TrafficActionExtended
   400      // - RedirectTwoOctetAsSpecificExtended
   401      // - RedirectIPv4AddressSpecificExtended
   402      // - RedirectFourOctetAsSpecificExtended
   403      // - TrafficRemarkExtended
   404      // - UnknownExtended
   405      repeated google.protobuf.Any communities = 1;
   406  }
   407  
   408  message As4PathAttribute {
   409      repeated AsSegment segments = 1;
   410  }
   411  
   412  message As4AggregatorAttribute {
   413      uint32 as = 2;
   414      string address = 3;
   415  }
   416  
   417  message PmsiTunnelAttribute {
   418      uint32 flags = 1;
   419      uint32 type = 2;
   420      uint32 label = 3;
   421      bytes id = 4;
   422  }
   423  
   424  message TunnelEncapSubTLVEncapsulation {
   425      uint32 key = 1;
   426      bytes cookie = 2;
   427  }
   428  
   429  message TunnelEncapSubTLVProtocol {
   430      uint32 protocol = 1;
   431  }
   432  
   433  message TunnelEncapSubTLVColor {
   434      uint32 color = 1;
   435  }
   436  
   437  message TunnelEncapSubTLVUnknown {
   438      uint32 type = 1;
   439      bytes value = 2;
   440  }
   441  
   442  message TunnelEncapTLV {
   443      uint32 type = 1;
   444      // Each TLV must be one of:
   445      // - TunnelEncapSubTLVEncapsulation
   446      // - TunnelEncapSubTLVProtocol
   447      // - TunnelEncapSubTLVColor
   448      // - TunnelEncapSubTLVUnknown
   449      repeated google.protobuf.Any tlvs = 2;
   450  }
   451  
   452  message TunnelEncapAttribute {
   453      repeated TunnelEncapTLV tlvs = 1;
   454  }
   455  
   456  message IPv6AddressSpecificExtended {
   457      bool is_transitive = 1;
   458      uint32 sub_type = 2;
   459      string address = 3;
   460      uint32 local_admin = 4;
   461  }
   462  
   463  message RedirectIPv6AddressSpecificExtended {
   464      string address = 1;
   465      uint32 local_admin = 2;
   466  }
   467  
   468  message IP6ExtendedCommunitiesAttribute {
   469      // Each Community must be one of:
   470      // - IPv6AddressSpecificExtended
   471      // - RedirectIPv6AddressSpecificExtended
   472      repeated google.protobuf.Any communities = 1;
   473  }
   474  
   475  message AigpTLVIGPMetric {
   476      uint64 metric = 1;
   477  }
   478  
   479  message AigpTLVUnknown {
   480      uint32 type = 1;
   481      bytes value = 2;
   482  }
   483  
   484  message AigpAttribute {
   485      // Each TLV must be one of:
   486      // - AigpTLVIGPMetric
   487      // - AigpTLVUnknown
   488      repeated google.protobuf.Any tlvs = 1;
   489  }
   490  
   491  message LargeCommunity {
   492      uint32 global_admin = 1;
   493      uint32 local_data1 = 2;
   494      uint32 local_data2 = 3;
   495  }
   496  
   497  message LargeCommunitiesAttribute {
   498      repeated LargeCommunity communities = 1;
   499  }
   500  
   501  message UnknownAttribute {
   502      uint32 flags = 1;
   503      uint32 type = 2;
   504      bytes value = 3;
   505  }