aboutsummaryrefslogtreecommitdiff
path: root/lib/socket-util.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-08-09 21:14:23 -0700
committerBen Pfaff <blp@nicira.com>2013-08-09 21:14:23 -0700
commit259e0b1ad1bfea762a76f0098deb8f8d8db1dfa3 (patch)
tree40ef603fd6f4f435c696c0aed554ef968adb68c4 /lib/socket-util.h
parent86f1d0326bd07ebf0f3dcb197007d7b67c205cbe (diff)
netdev-linux, netdev-bsd: Make access to AF_INET socket thread-safe.
The only uses of 'af_inet_sock', in both drivers, were ioctls, so it seemed like a good abstraction to write a function that just does such an ioctl, and to factor out shared code into socket-util. Signed-off-by: Ben Pfaff <blp@nicira.com> CC: Ed Maste <emaste@freebsd.org>
Diffstat (limited to 'lib/socket-util.h')
-rw-r--r--lib/socket-util.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/socket-util.h b/lib/socket-util.h
index 96aad5d1..670eeb34 100644
--- a/lib/socket-util.h
+++ b/lib/socket-util.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -97,4 +97,10 @@ int recv_data_and_fds(int sock,
void *data, size_t size,
int fds[SOUTIL_MAX_FDS], size_t *n_fdsp);
+/* Helpers for calling ioctl() on an AF_INET socket. */
+struct ifreq;
+int af_inet_ioctl(unsigned long int command, const void *arg);
+int af_inet_ifreq_ioctl(const char *name, struct ifreq *,
+ unsigned long int cmd, const char *cmd_name);
+
#endif /* socket-util.h */