go.ligato.io/vpp-agent/v3@v3.5.0/proto/ligato/netalloc/netalloc.proto (about)

     1  syntax = "proto3";
     2  
     3  // Netalloc allows to disassociate topology from addressing in the network
     4  // configuration. Instead of inserting specific IP/MAC addresses, VXLAN VNIs, etc.,
     5  // into the configuration data for interfaces, routes, ARPs and other network
     6  // objects, the addresses can be symbolic references into the pool of allocated
     7  // addresses known to the netalloc plugin.
     8  //
     9  // The ability to separate addresses from the rest of the network configuration
    10  // is especially useful in scenarios where address allocations are provided
    11  // externally, for example by another control-plane agent, IPAM tool or by CNI
    12  // in containerized environments.
    13  //
    14  // But for now, only model for IP address allocations has been implemented.
    15  // To allocate a new IP address, an instance of the proto message IPAllocation
    16  // should be submitted into the vpp-agent through one of the supported NB
    17  // transports (etcd, GRPC, ...) under the corresponding key. Network object which
    18  // references (to-be or already) allocated address will have a dependency on the
    19  // corresponding key-value instance of IPAllocation and will read and apply the
    20  // address only once it is available.
    21  package ligato.netalloc;
    22  
    23  option go_package = "go.ligato.io/vpp-agent/v3/proto/ligato/netalloc";
    24  
    25  import "ligato/annotations.proto";
    26  
    27  // IPAddressForm can be used in descriptors whose models reference allocated IP
    28  // addresses, to ask for a specific form in which the address should applied.
    29  enum IPAddressForm {
    30      UNDEFINED_FORM = 0;
    31  
    32      // ADDR_ONLY = apply address without mask, e.g. 192.168.2.5
    33      ADDR_ONLY = 1;
    34  
    35      // ADDR_WITH_MASK = apply address including the mask of the network,
    36      // e.g. 192.168.2.5/24
    37      ADDR_WITH_MASK = 2;
    38  
    39      // ADDR_NET = apply network implied by the address,
    40      // e.g. for 192.168.2.10/24 apply 192.168.2.0/24
    41      ADDR_NET = 3;
    42  
    43      // SINGLE_ADDR_NET = apply address with an all-ones mask (i.e. /32 for IPv4,
    44      // /128 for IPv6)
    45      SINGLE_ADDR_NET = 4;
    46  };
    47  
    48  // IPAddressSource can be used to remember the source of an IP address.
    49  // (e.g. to distinguish allocated IP addresses from statically defined ones)
    50  enum IPAddressSource {
    51      UNDEFINED_SOURCE = 0;
    52  
    53      // STATIC is IP address statically assigned in the NB configuration.
    54      STATIC = 1;
    55  
    56      // FROM_DHCP is set when IP address is obtained from DHCP.
    57      FROM_DHCP = 2;
    58  
    59      // ALLOC_REF is a reference inside NB configuration to an allocated
    60      // IP address.
    61      ALLOC_REF = 3;
    62  
    63      // EXISTING is set when IP address is assigned to (EXISTING) interface
    64      // externally (i.e. by a different agent or manually by an administrator).
    65      EXISTING = 4;
    66  }
    67  
    68  // IPAllocation represents a single allocated IP address.
    69  //
    70  // To reference allocated address, instead of entering specific IP address
    71  // for interface/route/ARP/..., use one of the following string templates
    72  // prefixed with netalloc keyword "alloc" followed by colon:
    73  //  a) reference IP address allocated for an interface:
    74  //        "alloc:<network_name>/<interface_name>"
    75  //  b) when interface is given (e.g. when asked for IP from interface model),
    76  //     interface_name can be omitted:
    77  //        "alloc:<network_name>"
    78  //  c) reference default gateway IP address assigned to an interface:
    79  //        "alloc:<network_name>/<interface_name>/GW"
    80  //  d) when asking for GW IP for interface which is given, interface_name
    81  //     can be omitted:
    82  //        "alloc:<network_name>/GW"
    83  message IPAllocation {
    84      // NetworkName is some label assigned to the network where the IP address
    85      // was assigned to the given interface.
    86      // In theory, interface can have multiple IP adresses or there can be multiple
    87      // address allocators and the network name allows to separate them.
    88      // The network name is not allowed to contain forward slashes.
    89      string network_name = 1;
    90  
    91      // InterfaceName is the logical VPP or Linux interface name for which the
    92      // address is allocated.
    93      string interface_name = 2;
    94  
    95      // Address is an IP addres allocated to the interface inside the given
    96      // network.
    97      // If the address is specified without a mask, the all-ones mask (/32 for
    98      // IPv4, /128 for IPv6) will be assumed.
    99      string address = 4  [(ligato_options).type = IP_OPTIONAL_MASK];
   100  
   101      // Gw is the address of the default gateway assigned to the interface in
   102      // the given network.
   103      // If the address is specified without a mask, then either:
   104      //  a) the mask of the <address> is used provided that GW IP falls into the
   105      //     same network IP range, or
   106      //  b) the all-ones mask is used otherwise
   107      string gw = 5  [(ligato_options).type = IP_OPTIONAL_MASK];
   108  }
   109  
   110  // ConfigData wraps all configuration items exported by netalloc.
   111  // TBD: MACs, VXLAN VNIs, memif IDs, etc.
   112  message ConfigData {
   113      repeated IPAllocation ip_addresses = 10;
   114  }