1 | /*
|
---|
2 | * Unix SMB/CIFS implementation.
|
---|
3 | * Copyright (C) Volker Lendecke 2014
|
---|
4 | *
|
---|
5 | * This program is free software; you can redistribute it and/or modify
|
---|
6 | * it under the terms of the GNU General Public License as published by
|
---|
7 | * the Free Software Foundation; either version 3 of the License, or
|
---|
8 | * (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This program is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef __LIB_MSGHDR_H__
|
---|
20 | #define __LIB_MSGHDR_H__
|
---|
21 |
|
---|
22 | #include <stddef.h>
|
---|
23 | #include <stdint.h>
|
---|
24 | #include <sys/uio.h>
|
---|
25 | #include <sys/socket.h>
|
---|
26 |
|
---|
27 | ssize_t msghdr_prep_fds(struct msghdr *msg, uint8_t *buf, size_t bufsize,
|
---|
28 | const int *fds, size_t num_fds);
|
---|
29 |
|
---|
30 | struct msghdr_buf;
|
---|
31 |
|
---|
32 | ssize_t msghdr_copy(struct msghdr_buf *msg, size_t msgsize,
|
---|
33 | const void *addr, socklen_t addrlen,
|
---|
34 | const struct iovec *iov, int iovcnt,
|
---|
35 | const int *fds, size_t num_fds);
|
---|
36 | struct msghdr *msghdr_buf_msghdr(struct msghdr_buf *msg);
|
---|
37 |
|
---|
38 | size_t msghdr_prep_recv_fds(struct msghdr *msg, uint8_t *buf, size_t bufsize,
|
---|
39 | size_t num_fds);
|
---|
40 | size_t msghdr_extract_fds(struct msghdr *msg, int *fds, size_t num_fds);
|
---|
41 |
|
---|
42 | #endif
|
---|