#include "lib/utils.h"

/*
 cilium.v6.external.str fc00:c111::5
 cilium.v6.internal.str fd00:10:244::8ae
 cilium.v6.nodeport.str [fc00:c111::5]

 cilium.v4.external.str 172.18.0.5
 cilium.v4.internal.str 10.244.0.175
 cilium.v4.nodeport.str [172.18.0.5]

 cilium.v6.internal.raw 0xfd, 0x0, 0x0, 0x10, 0x2, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xae
 cilium.v4.internal.raw 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0xf4, 0x0, 0xaf
 */

#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={0xe2,0x55,0x7d,0xb3,0x37,0xca}}
#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={0x72,0x3f,0xa0,0x29,0x6f,0xc}}
#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 0xaf00f40a
#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 = {0x9a,0xce,0x4b,0x5e,0xcc,0x85}}; __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: eyJBTExPV19JQ01QX0ZSQUdfTkVFREVEIjoiMSIsIkFVVEhfTUFQX1NJWkUiOiI1MjQyODgiLCJDSURSX0lERU5USVRZX1JBTkdFX0VORCI6IjMzNTU0NDMxIiwiQ0lEUl9JREVOVElUWV9SQU5HRV9TVEFSVCI6IjE2Nzc3MjE3IiwiQ0lMSVVNX0hPU1RfSUZJTkRFWCI6IjYiLCJDSUxJVU1fSE9TVF9NQUMiOiJ7LmFkZHI9ezB4ZTIsMHg1NSwweDdkLDB4YjMsMHgzNywweGNhfX0iLCJDSUxJVU1fSVBWNF9GUkFHX01BUF9NQVhfRU5UUklFUyI6IjgxOTIiLCJDSUxJVU1fSVBWNl9GUkFHX01BUF9NQVhfRU5UUklFUyI6IjgxOTIiLCJDSUxJVU1fTEJfQUZGSU5JVFlfTUFQX01BWF9FTlRSSUVTIjoiNjU1MzYiLCJDSUxJVU1fTEJfQkFDS0VORFNfTUFQX01BWF9FTl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