if_vxlan.h (8f0ea33f2bbf3a6aa80235f0a02fa5f2780c2b17) | if_vxlan.h (33e0d8f057cf6eda187f09c76ea968c19e176b74) |
---|---|
1/*- 2 * Copyright (c) 2014, Bryan Venteicher <bryanv@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 40 unchanged lines hidden (view full) --- 49/* 50 * The port assigned by IANA is 4789, but some early implementations 51 * (like Linux) use 8472 instead. If not specified, we default to 52 * the IANA port. 53 */ 54#define VXLAN_PORT 4789 55#define VXLAN_LEGACY_PORT 8472 56 | 1/*- 2 * Copyright (c) 2014, Bryan Venteicher <bryanv@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 40 unchanged lines hidden (view full) --- 49/* 50 * The port assigned by IANA is 4789, but some early implementations 51 * (like Linux) use 8472 instead. If not specified, we default to 52 * the IANA port. 53 */ 54#define VXLAN_PORT 4789 55#define VXLAN_LEGACY_PORT 8472 56 |
57union vxlan_sockaddr { 58 struct sockaddr sa; 59 struct sockaddr_in in4; 60 struct sockaddr_in6 in6; 61}; 62 |
|
57struct ifvxlanparam { 58 uint64_t vxlp_with; 59 60#define VXLAN_PARAM_WITH_VNI 0x0001 61#define VXLAN_PARAM_WITH_LOCAL_ADDR4 0x0002 62#define VXLAN_PARAM_WITH_LOCAL_ADDR6 0x0004 63#define VXLAN_PARAM_WITH_REMOTE_ADDR4 0x0008 64#define VXLAN_PARAM_WITH_REMOTE_ADDR6 0x0010 65#define VXLAN_PARAM_WITH_LOCAL_PORT 0x0020 66#define VXLAN_PARAM_WITH_REMOTE_PORT 0x0040 67#define VXLAN_PARAM_WITH_PORT_RANGE 0x0080 68#define VXLAN_PARAM_WITH_FTABLE_TIMEOUT 0x0100 69#define VXLAN_PARAM_WITH_FTABLE_MAX 0x0200 70#define VXLAN_PARAM_WITH_MULTICAST_IF 0x0400 71#define VXLAN_PARAM_WITH_TTL 0x0800 72#define VXLAN_PARAM_WITH_LEARN 0x1000 73 74 uint32_t vxlp_vni; | 63struct ifvxlanparam { 64 uint64_t vxlp_with; 65 66#define VXLAN_PARAM_WITH_VNI 0x0001 67#define VXLAN_PARAM_WITH_LOCAL_ADDR4 0x0002 68#define VXLAN_PARAM_WITH_LOCAL_ADDR6 0x0004 69#define VXLAN_PARAM_WITH_REMOTE_ADDR4 0x0008 70#define VXLAN_PARAM_WITH_REMOTE_ADDR6 0x0010 71#define VXLAN_PARAM_WITH_LOCAL_PORT 0x0020 72#define VXLAN_PARAM_WITH_REMOTE_PORT 0x0040 73#define VXLAN_PARAM_WITH_PORT_RANGE 0x0080 74#define VXLAN_PARAM_WITH_FTABLE_TIMEOUT 0x0100 75#define VXLAN_PARAM_WITH_FTABLE_MAX 0x0200 76#define VXLAN_PARAM_WITH_MULTICAST_IF 0x0400 77#define VXLAN_PARAM_WITH_TTL 0x0800 78#define VXLAN_PARAM_WITH_LEARN 0x1000 79 80 uint32_t vxlp_vni; |
75 struct in_addr vxlp_local_in4; 76 struct in6_addr vxlp_local_in6; 77 struct in_addr vxlp_remote_in4; 78 struct in6_addr vxlp_remote_in6; | 81 union vxlan_sockaddr vxlp_local_sa; 82 union vxlan_sockaddr vxlp_remote_sa; |
79 uint16_t vxlp_local_port; 80 uint16_t vxlp_remote_port; 81 uint16_t vxlp_min_port; 82 uint16_t vxlp_max_port; 83 char vxlp_mc_ifname[IFNAMSIZ]; 84 uint32_t vxlp_ftable_timeout; 85 uint32_t vxlp_ftable_max; 86 uint8_t vxlp_ttl; 87 uint8_t vxlp_learn; 88}; 89 | 83 uint16_t vxlp_local_port; 84 uint16_t vxlp_remote_port; 85 uint16_t vxlp_min_port; 86 uint16_t vxlp_max_port; 87 char vxlp_mc_ifname[IFNAMSIZ]; 88 uint32_t vxlp_ftable_timeout; 89 uint32_t vxlp_ftable_max; 90 uint8_t vxlp_ttl; 91 uint8_t vxlp_learn; 92}; 93 |
90union vxlan_sockaddr { 91 struct sockaddr sa; 92 struct sockaddr_in in4; 93 struct sockaddr_in6 in6; 94}; 95 | |
96#define VXLAN_SOCKADDR_IS_IPV4(_vxsin) ((_vxsin)->sa.sa_family == AF_INET) 97#define VXLAN_SOCKADDR_IS_IPV6(_vxsin) ((_vxsin)->sa.sa_family == AF_INET6) 98#define VXLAN_SOCKADDR_IS_IPV46(_vxsin) \ 99 (VXLAN_SOCKADDR_IS_IPV4(_vxsin) || VXLAN_SOCKADDR_IS_IPV6(_vxsin)) 100 101#define VXLAN_CMD_GET_CONFIG 0 102#define VXLAN_CMD_SET_VNI 1 103#define VXLAN_CMD_SET_LOCAL_ADDR 2 --- 45 unchanged lines hidden --- | 94#define VXLAN_SOCKADDR_IS_IPV4(_vxsin) ((_vxsin)->sa.sa_family == AF_INET) 95#define VXLAN_SOCKADDR_IS_IPV6(_vxsin) ((_vxsin)->sa.sa_family == AF_INET6) 96#define VXLAN_SOCKADDR_IS_IPV46(_vxsin) \ 97 (VXLAN_SOCKADDR_IS_IPV4(_vxsin) || VXLAN_SOCKADDR_IS_IPV6(_vxsin)) 98 99#define VXLAN_CMD_GET_CONFIG 0 100#define VXLAN_CMD_SET_VNI 1 101#define VXLAN_CMD_SET_LOCAL_ADDR 2 --- 45 unchanged lines hidden --- |