vcpkg
vexxhost
Viktor
+VLAN
VM
VMS
VMware
variable.md \
verbose.md \
version.md \
+ vlan-priority.md \
write-out.md \
xattr.md
Multi: single
See-also:
- tcp-nodelay
+ - vlan-priority
Example:
- --ip-tos CS5 $URL
---
--- /dev/null
+---
+c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
+SPDX-License-Identifier: curl
+Long: vlan-priority
+Arg: <priority>
+Help: Set VLAN priority
+Added: 8.9.0
+Category: connection
+Protocols: All
+Multi: single
+See-also:
+ - ip-tos
+Example:
+ - --vlan-priority 4 $URL
+---
+
+# `--vlan-priority`
+
+Set VLAN priority as defined in IEEE 802.1Q. (Added in 8.9.0).
+
+This field is set on Ethernet level, and only works within a local network.
+
+The valid range for \<priority\> is 0 to 7.
--variable 8.3.0
--verbose (-v) 4.0
--version (-V) 4.0
+--vlan-priority 8.9.0
--write-out (-w) 6.5
--xattr 7.21.3
long low_speed_limit;
long low_speed_time;
long ip_tos; /* IP Type of Service */
+ long vlan_priority; /* VLAN priority */
char *dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */
char *dns_interface; /* interface name */
char *dns_ipv4_addr; /* dot notation */
C_VARIABLE,
C_VERBOSE,
C_VERSION,
+ C_VLAN_PRIORITY,
C_WDEBUG,
C_WRITE_OUT,
C_XATTR
{"variable", ARG_STRG, ' ', C_VARIABLE},
{"verbose", ARG_BOOL, 'v', C_VERBOSE},
{"version", ARG_BOOL, 'V', C_VERSION},
+ {"vlan-priority", ARG_STRG, ' ', C_VLAN_PRIORITY},
#ifdef USE_WATT32
{"wdebug", ARG_BOOL, ' ', C_WDEBUG},
#endif
err = str2unummax(&config->ip_tos, nextarg, 0xFF);
break;
}
+ case C_VLAN_PRIORITY: /* --vlan-priority */
+ err = str2unummax(&config->vlan_priority, nextarg, 7);
+ break;
case C_PROXY_DIGEST: /* --proxy-digest */
config->proxydigest = toggle;
break;
{"-V, --version",
"Show version number and quit",
CURLHELP_IMPORTANT | CURLHELP_CURL},
+ {" --vlan-priority <priority>",
+ "Set VLAN priority",
+ CURLHELP_CONNECTION},
{"-w, --write-out <format>",
"Output FORMAT after completion",
CURLHELP_VERBOSE},
}
#endif
-#if defined(IP_TOS) || defined(IPV6_TCLASS)
+#if defined(IP_TOS) || defined(IPV6_TCLASS) || defined(SO_PRIORITY)
static int sockopt_callback(void *clientp, curl_socket_t curlfd,
curlsocktype purpose)
{
return CURL_SOCKOPT_OK;
(void)config;
(void)curlfd;
+#if defined(IP_TOS) || defined(IPV6_TCLASS)
if(config->ip_tos > 0) {
int tos = (int)config->ip_tos;
int result = 0;
tos, error, strerror(error));
}
}
+#endif
+#ifdef SO_PRIORITY
+ if(config->vlan_priority > 0) {
+ int priority = (int)config->vlan_priority;
+ if(setsockopt(curlfd, SOL_SOCKET, SO_PRIORITY,
+ (const char *)&priority, sizeof(priority)) != 0) {
+ int error = errno;
+ warnf(config->global, "VLAN priority %d failed with errno %d: %s;\n",
+ priority, error, strerror(error));
+ }
+ }
+#endif
return CURL_SOCKOPT_OK;
}
#endif
#endif
/* new in 8.9.0 */
- if(config->ip_tos > 0) {
-#if defined(IP_TOS) || defined(IPV6_TCLASS)
+ if(config->ip_tos > 0 || config->vlan_priority > 0) {
+#if defined(IP_TOS) || defined(IPV6_TCLASS) || defined(SO_PRIORITY)
my_setopt(curl, CURLOPT_SOCKOPTFUNCTION, sockopt_callback);
my_setopt(curl, CURLOPT_SOCKOPTDATA, config);
#else
- warnf(config->global,
- "Type of service is not supported in this build.");
+ if(config->ip_tos > 0) {
+ errorf(config->global,
+ "Type of service is not supported in this build.");
+ result = CURLE_NOT_BUILT_IN;
+ }
+ if(config->vlan_priority > 0) {
+ errorf(config->global,
+ "VLAN priority is not supported in this build.");
+ result = CURLE_NOT_BUILT_IN;
+ }
#endif
}