* If 'sinp' is non-null, then on success the target address is stored into
* '*sinp'.
*
- * 'dscp' If not DSCP_INVALID, its value becomes the DSCP bits in the IP
- * headers for the new connection. */
+ * 'dscp' becomes the DSCP bits in the IP headers for the new connection. */
int
inet_open_active(int style, const char *target, uint16_t default_port,
struct sockaddr_in *sinp, int *fdp, uint8_t dscp)
/* The socket options set here ensure that the TOS bits are set during
* the connection establishment. If set after connect(), the handshake
* SYN frames will be sent with a TOS of 0. */
- if (dscp != DSCP_INVALID) {
- if (setsockopt(fd, IPPROTO_IP, IP_TOS, &dscp, sizeof dscp)) {
- VLOG_ERR("%s: socket: %s", target, strerror(errno));
- error = errno;
- goto exit;
- }
+ if (setsockopt(fd, IPPROTO_IP, IP_TOS, &dscp, sizeof dscp)) {
+ VLOG_ERR("%s: socket: %s", target, strerror(errno));
+ error = errno;
+ goto exit;
}
/* Connect. */
* If 'sinp' is non-null, then on success the bound address is stored into
* '*sinp'.
*
- * 'dscp' If not DSCP_INVALID, its value becomes the DSCP bits in the IP
- * headers for the new connection. */
+ * 'dscp' becomes the DSCP bits in the IP headers for the new connection. */
int
inet_open_passive(int style, const char *target, int default_port,
struct sockaddr_in *sinp, uint8_t dscp)
/* The socket options set here ensure that the TOS bits are set during
* the connection establishment. If set after connect(), the handshake
* SYN frames will be sent with a TOS of 0. */
- if (dscp != DSCP_INVALID) {
- if (setsockopt(fd, IPPROTO_IP, IP_TOS, &dscp, sizeof dscp)) {
- VLOG_ERR("%s: socket: %s", target, strerror(errno));
- error = errno;
- goto error;
- }
+ if (setsockopt(fd, IPPROTO_IP, IP_TOS, &dscp, sizeof dscp)) {
+ VLOG_ERR("%s: socket: %s", target, strerror(errno));
+ error = errno;
+ goto error;
}
/* Listen. */
* in <netinet/ip.h> is used. */
#define DSCP_DEFAULT IPTOS_PREC_INTERNETCONTROL
-/* Invalid dscp value. If the dscp value will not be used, the dscp value
- * passed must be invalid. Set to 0xFF as the TOS bits passed can only be
- * 6 bits. */
-#define DSCP_INVALID 0xFF
-
#endif /* socket-util.h */
*
* 'suffix' is a copy of 'name' following the colon and may be modified.
* 'dscp' is the DSCP value that the new connection should use in the IP
- * packets it sends. (If no DSCP value should be set in the packet, dscp
- * will be set to DSCP_INVALID. If no DSCP value is specified, DSCP_DEFAULT
- * value will be applied.)
+ * packets it sends.
*
* Returns 0 if successful, otherwise a positive errno value. If
* successful, stores a pointer to the new connection in '*streamp'.
*
* 'suffix' is a copy of 'name' following the colon and may be modified.
* 'dscp' is the DSCP value that the new connection should use in the IP
- * packets it sends. (If no DSCP value should be set in the packet, dscp
- * will be set to DSCP_INVALID. If no DSCP value is specified, DSCP_DEFAULT
- * value will be applied.)
+ * packets it sends.
*
* Returns 0 if successful, otherwise a positive errno value. If
* successful, stores a pointer to the new connection in '*pstreamp'.
program_name, (long int) getpid());
}
- error = pstream_open(punix_path, &listener, DSCP_INVALID);
+ error = pstream_open(punix_path, &listener, 0);
if (error) {
ovs_error(error, "could not initialize control socket %s", punix_path);
goto exit;
*
* 'suffix' is a copy of 'name' following the colon and may be modified.
* 'dscp' is the DSCP value that the new connection should use in the IP
- * packets it sends. (If no DSCP value should be set in the packet, dscp
- * will be set to DSCP_INVALID. If no DSCP value is specified, DSCP_DEFAULT
- * value will be applied.)
+ * packets it sends.
*
* Returns 0 if successful, otherwise a positive errno value. If
* successful, stores a pointer to the new connection in '*vconnp'.
*
* 'suffix' is a copy of 'name' following the colon and may be modified.
* 'dscp' is the DSCP value that the new connection should use in the IP
- * packets it sends. (If no DSCP value should be set in the packet, dscp
- * will be set to DSCP_INVALID. If no DSCP value is specified, DSCP_DEFAULT
- * value will be applied.)
+ * packets it sends.
*
* Returns 0 if successful, otherwise a positive errno value. If
* successful, stores a pointer to the new connection in '*pvconnp'.
int error;
int fd;
- error = inet_open_active(SOCK_DGRAM, name, default_port, NULL, &fd,
- DSCP_INVALID);
+ error = inet_open_active(SOCK_DGRAM, name, default_port, NULL, &fd, 0);
if (fd >= 0) {
c->fds[c->n_fds++] = fd;
} else {
struct pvconn *pvconn;
int error;
- error = pvconn_open(name, &pvconn, DSCP_INVALID);
+ error = pvconn_open(name, &pvconn, 0);
if (!error) {
pvconns[n_pvconns++] = pvconn;
} else {
}
target = argv[optind];
- sock = inet_open_passive(SOCK_DGRAM, target, 0, NULL, DSCP_INVALID);
+ sock = inet_open_passive(SOCK_DGRAM, target, 0, NULL, 0);
if (sock < 0) {
ovs_fatal(0, "%s: failed to open (%s)", argv[1], strerror(-sock));
}