syntax = "proto3";

package api;

option go_package = "github.com/osrg/gobgp/v4/api;api";

// Common types for pretty much everywhere

message Family {
  enum Afi {
    AFI_UNSPECIFIED = 0;
    AFI_IP = 1;
    AFI_IP6 = 2;
    AFI_L2VPN = 25;
    AFI_LS = 16388;
    AFI_OPAQUE = 16397;
  }

  enum Safi {
    SAFI_UNSPECIFIED = 0;
    SAFI_UNICAST = 1;
    SAFI_MULTICAST = 2;
    SAFI_MPLS_LABEL = 4;
    SAFI_ENCAPSULATION = 7;
    SAFI_VPLS = 65;
    SAFI_EVPN = 70;
    SAFI_LS = 71;
    SAFI_SR_POLICY = 73;
    SAFI_MUP = 85;
    SAFI_MPLS_VPN = 128;
    SAFI_MPLS_VPN_MULTICAST = 129;
    SAFI_ROUTE_TARGET_CONSTRAINTS = 132;
    SAFI_FLOW_SPEC_UNICAST = 133;
    SAFI_FLOW_SPEC_VPN = 134;
    SAFI_KEY_VALUE = 241;
  }

  Afi afi = 1;
  Safi safi = 2;
}

message RouteDistinguisherTwoOctetASN {
  uint32 admin = 1;
  uint32 assigned = 2;
}

message RouteDistinguisherIPAddress {
  string admin = 1;
  uint32 assigned = 2;
}

message RouteDistinguisherFourOctetASN {
  uint32 admin = 1;
  uint32 assigned = 2;
}

message RouteDistinguisher {
  oneof rd {
    RouteDistinguisherTwoOctetASN two_octet_asn = 1;
    RouteDistinguisherIPAddress ip_address = 2;
    RouteDistinguisherFourOctetASN four_octet_asn = 3;
  }
}
