aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lb/lb_types.api
blob: a6e1980b6be921672870bb833d6ad7274423dd30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2019 Vinci Consulting Corp.  All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
option version = "1.0.0";
import "vnet/ip/ip_types.api";

enum lb_srv_type
{
  LB_API_SRV_TYPE_CLUSTERIP = 0,
  LB_API_SRV_TYPE_NODEPORT = 1,
  LB_API_SRV_N_TYPES = 2,
};

enum lb_encap_type
{
  LB_API_ENCAP_TYPE_GRE4 = 0,
  LB_API_ENCAP_TYPE_GRE6 = 1,
  LB_API_ENCAP_TYPE_L3DSR = 2,
  LB_API_ENCAP_TYPE_NAT4 = 3,
  LB_API_ENCAP_TYPE_NAT6 = 4,
  LB_API_ENCAP_N_TYPES = 5,
};

/* Lookup types */
enum lb_lkp_type_t
{
  LB_API_LKP_SAME_IP_PORT = 0,
  LB_API_LKP_DIFF_IP_PORT = 1,
  LB_API_LKP_ALL_PORT_IP = 2,
  LB_API_LKP_N_TYPES = 3,
};

enum lb_vip_type
{
  LB_API_VIP_TYPE_IP6_GRE6 = 0,
  LB_API_VIP_TYPE_IP6_GRE4 = 1,
  LB_API_VIP_TYPE_IP4_GRE6 = 2,
  LB_API_VIP_TYPE_IP4_GRE4 = 3,
  LB_API_VIP_TYPE_IP4_L3DSR = 4,
  LB_API_VIP_TYPE_IP4_NAT4 = 5,
  LB_API_VIP_TYPE_IP6_NAT6 = 6,
  LB_API_VIP_N_TYPES = 7,
};

enum lb_nat_protocol
{
  LB_API_NAT_PROTOCOL_UDP = 0x06,
  LB_API_NAT_PROTOCOL_TCP = 0x17,
  LB_API_NAT_PROTOCOL_ANY = 0xffffffff,
};

/** \brief Define connection statistics structure
    @param pfx - ip prefix and length
    @param protocol - tcp or udp.
    @param port - destination port.
*/
typedef lb_vip
{
  vl_api_address_with_prefix_t pfx;
  vl_api_ip_proto_t protocol;
  u16 port;
};