summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-05-23 15:42:14 +0200
committerAndreas Schneider <asn@samba.org>2014-05-26 16:45:16 +0200
commitc9332d48d55925c585641bbd7069f3a4c774e3c1 (patch)
tree08e40380052032feb9149c4dfa928b0f5acd7afe /src
parent3c55e35cad90ef3c1126b390cf53b860c99fdd6e (diff)
downloadsocket_wrapper-c9332d48d55925c585641bbd7069f3a4c774e3c1.tar.gz
socket_wrapper-c9332d48d55925c585641bbd7069f3a4c774e3c1.tar.xz
socket_wrapper-c9332d48d55925c585641bbd7069f3a4c774e3c1.zip
swrap: Add swrap_sendmsg_filter_cmsghdr().
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'src')
-rw-r--r--src/socket_wrapper.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 7a0b63c..26750b0 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -3144,6 +3144,33 @@ static int swrap_msghdr_add_socket_info(struct socket_info *si,
return rc;
}
+
+static int swrap_sendmsg_filter_cmsghdr(struct msghdr *msg,
+ uint8_t *cm_data,
+ size_t *cm_data_space) {
+ struct cmsghdr *cmsg;
+ int rc = -1;
+
+ /* Nothing to do */
+ if (msg->msg_controllen == 0 || msg->msg_control == NULL) {
+ return 0;
+ }
+
+ for (cmsg = CMSG_FIRSTHDR(msg);
+ cmsg != NULL;
+ cmsg = CMSG_NXTHDR(msg, cmsg)) {
+ switch (cmsg->cmsg_level) {
+ case IPPROTO_IP:
+ /* TODO swrap_sendmsg_filter_cmsg_socket */
+ break;
+ default:
+ /* TODO swrap_sendmsg_copy_cmsg */
+ break;
+ }
+ }
+
+ return rc;
+}
#endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */
static ssize_t swrap_sendmsg_before(int fd,