#include "lib/utils.h"

/*
 cilium.v6.external.str fc00:c111::4
 cilium.v6.internal.str fd00:10:244:3::e7e2
 cilium.v6.nodeport.str [fc00:c111::4]

 cilium.v4.external.str 172.18.0.4
 cilium.v4.internal.str 10.244.3.143
 cilium.v4.nodeport.str [172.18.0.4]

 cilium.v6.internal.raw 0xfd, 0x0, 0x0, 0x10, 0x2, 0x44, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe7, 0xe2
 cilium.v4.internal.raw 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0xf4, 0x3, 0x8f
 */

#define IPV6_DIRECT_ROUTING { .addr = {  } }
#define CT_MAP_SIZE_TCP 131072
#define CT_MAP_SIZE_ANY 65536
DECLARE_CONFIG(__u32, identity_length, "Identity length in bits");
ASSIGN_CONFIG(__u32, identity_length, 16);
DECLARE_CONFIG(__u32, interface_ifindex, "ifindex of the interface the bpf program is attached to");
#define ALLOW_ICMP_FRAG_NEEDED 1
#define AUTH_MAP_SIZE 524288
#define CIDR_IDENTITY_RANGE_END 33554431
#define CIDR_IDENTITY_RANGE_START 16777217
#define CILIUM_HOST_IFINDEX 6
#define CILIUM_HOST_MAC {.addr={0x26,0xce,0x18,0xe5,0xc6,0x69}}
#define CILIUM_IPV4_FRAG_MAP_MAX_ENTRIES 8192
#define CILIUM_IPV6_FRAG_MAP_MAX_ENTRIES 8192
#define CILIUM_LB_AFFINITY_MAP_MAX_ENTRIES 65536
#define CILIUM_LB_BACKENDS_MAP_MAX_ENTRIES 65536
#define CILIUM_LB_MAGLEV_MAP_MAX_ENTRIES 65536
#define CILIUM_LB_REV_NAT_MAP_MAX_ENTRIES 65536
#define CILIUM_LB_SERVICE_MAP_MAX_ENTRIES 65536
#define CILIUM_LB_SKIP_MAP_MAX_ENTRIES 100
#define CILIUM_LB_SOURCE_RANGE_MAP_MAX_ENTRIES 65536
#define CILIUM_NET_IFINDEX 5
#define CILIUM_NET_MAC {.addr={0x82,0x52,0x42,0x7b,0xca,0x46}}
#define CLUSTER_ID_MAX 255
#define CONFIG_MAP_SIZE 256
#define CT_CLOSE_TIMEOUT 10
#define CT_CONNECTION_LIFETIME_NONTCP 60
#define CT_CONNECTION_LIFETIME_TCP 8000
#define CT_REPORT_FLAGS 0x00ff
#define CT_REPORT_INTERVAL 5
#define CT_SERVICE_CLOSE_REBALANCE 60
#define CT_SERVICE_LIFETIME_NONTCP 60
#define CT_SERVICE_LIFETIME_TCP 8000
#define CT_SYN_TIMEOUT 60
#define EGRESS_POLICY_MAP_SIZE 16384
#define ENABLE_ENDPOINT_ROUTES 1
#define ENABLE_ICMP_RULE 1
#define ENABLE_IDENTITY_MARK 1
#define ENABLE_IPSEC 1
#define ENABLE_IPV4 1
#define ENABLE_IPV4_FRAGMENTS 1
#define ENABLE_IPV6 1
#define ENABLE_IPV6_FRAGMENTS 1
#define ENABLE_SESSION_AFFINITY 1
#define ENCRYPTED_OVERLAY_ID 11
#define ENDPOINTS_MAP_SIZE 65535
#define EPHEMERAL_MIN 32768
#define EVENTS_MAP_BURST_LIMIT 0
#define EVENTS_MAP_RATE_LIMIT 0
#define HASH_INIT4_SEED 1910299206
#define HASH_INIT6_SEED 2454738568
#define HEALTH_ID 4
#define HOST_ID 1
#define INIT_ID 5
#define IPCACHE_MAP_SIZE 512000
#define IPV4_DIRECT_ROUTING 0
#define IPV4_GATEWAY 0x8f03f40a
#define IPV4_MASK 0xffffff
#define IS_L3_DEV(ifindex) false
#define KERNEL_HZ 1000
#define KUBE_APISERVER_NODE_ID 7
#define L2_RESPONDER_MAP4_SIZE 4096
#define L2_RESPONDER_MAP6_SIZE 4096
#define LB4_REVERSE_NAT_SK_MAP_SIZE 65536
#define LB6_REVERSE_NAT_SK_MAP_SIZE 65536
#define LB_SELECTION 1
#define LB_SELECTION_MAGLEV 2
#define LB_SELECTION_RANDOM 1
#define LOCAL_NODE_ID 6
#define METRICS_MAP_SIZE 1024
#define MTU 1500
#define NATIVE_DEV_MAC_BY_IFINDEX(IFINDEX) ({ \
union macaddr __mac = {.addr = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}; \
switch (IFINDEX) { \
 case 3: {union macaddr __tmp = {.addr = {0xca,0x69,0xa,0xdf,0xa0,0x47}}; __mac=__tmp;} break; \
} \
__mac; })
#define NAT_46X64_PREFIX_0 0
#define NAT_46X64_PREFIX_1 0
#define NAT_46X64_PREFIX_2 0
#define NAT_46X64_PREFIX_3 0
#define NODE_MAP_SIZE 16384
#define POLICY_MAP_SIZE 16384
#define POLICY_PROG_MAP_SIZE 65535
#define POLICY_STATS_MAP_SIZE 65536
#define REMOTE_NODE_ID 6
#define SERVICE_NO_BACKEND_RESPONSE 1
#define THIS_INTERFACE_IFINDEX CONFIG(interface_ifindex)
#define UNKNOWN_ID 0
#define UNMANAGED_ID 3
#define VLAN_FILTER(ifindex, vlan_id) return false
#define WORLD_ID 2
#define WORLD_IPV4_ID 9
#define WORLD_IPV6_ID 10

// JSON_OUTPUT: eyJBTExPV19JQ01QX0ZSQUdfTkVFREVEIjoiMSIsIkFVVEhfTUFQX1NJWkUiOiI1MjQyODgiLCJDSURSX0lERU5USVRZX1JBTkdFX0VORCI6IjMzNTU0NDMxIiwiQ0lEUl9JREVOVElUWV9SQU5HRV9TVEFSVCI6IjE2Nzc3MjE3IiwiQ0lMSVVNX0hPU1RfSUZJTkRFWCI6IjYiLCJDSUxJVU1fSE9TVF9NQUMiOiJ7LmFkZHI9ezB4MjYsMHhjZSwweDE4LDB4ZTUsMHhjNiwweDY5fX0iLCJDSUxJVU1fSVBWNF9GUkFHX01BUF9NQVhfRU5UUklFUyI6IjgxOTIiLCJDSUxJVU1fSVBWNl9GUkFHX01BUF9NQVhfRU5UUklFUyI6IjgxOTIiLCJDSUxJVU1fTEJfQUZGSU5JVFlfTUFQX01BWF9FTlRSSUVTIjoiNjU1MzYiLCJDSUxJVU1fTEJfQkFDS0VORFNfTUFQX01BWF9FT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