#include "enums.h"
#include "smb_macros.h"
#include "smb.h"
-#include "lib/socket/socket.h"
#include "libcli/ldap/ldap.h"
#include "byteorder.h"
#include "module.h"
#include "asn_1.h"
#include "ldap_server/ldap_server.h"
#include "smbd/service_stream.h"
+#include "lib/socket/socket.h"
/*
close the socket and shutdown a server_context
#include "system/time.h"
#include "messages.h"
#include "dlinklist.h"
+#include "lib/socket/socket.h"
/* change the message version with any incompatible changes in the protocol */
#define MESSAGING_VERSION 1
#include "includes.h"
#include "system/network.h"
#include "system/iconv.h"
+#include "lib/socket/socket.h"
#define FAIL (-1)
#define ALLONES ((uint32_t)0xFFFFFFFF)
SUBSYSTEM = SOCKET
INIT_OBJ_FILES = \
lib/socket/socket_ipv4.o
+NOPROTO=YES
# End MODULE socket_ipv4
################################################
SUBSYSTEM = SOCKET
INIT_OBJ_FILES = \
lib/socket/socket_ipv6.o
+NOPROTO=YES
# End MODULE socket_ipv6
################################################
SUBSYSTEM = SOCKET
INIT_OBJ_FILES = \
lib/socket/socket_unix.o
+NOPROTO=YES
# End MODULE socket_unix
################################################
lib/socket/socket.o
ADD_OBJ_FILES = \
lib/socket/access.o
+NOPROTO=YES
# End SUBSYSTEM SOCKET
################################################
*/
#include "includes.h"
+#include "lib/socket/socket.h"
#include "system/filesys.h"
/*
const struct socket_ops *socket_getops_byname(const char *name, enum socket_type type)
{
+ extern const struct socket_ops *socket_ipv4_ops(enum socket_type );
+ extern const struct socket_ops *socket_ipv6_ops(enum socket_type );
+ extern const struct socket_ops *socket_unixdom_ops(enum socket_type );
+
if (strcmp("ip", name) == 0 ||
strcmp("ipv4", name) == 0) {
return socket_ipv4_ops(type);
const struct socket_ops *ops;
};
+
+/* prototypes */
+NTSTATUS socket_create(const char *name, enum socket_type type,
+ struct socket_context **new_sock, uint32_t flags);
+void socket_destroy(struct socket_context *sock);
+NTSTATUS socket_connect(struct socket_context *sock,
+ const char *my_address, int my_port,
+ const char *server_address, int server_port,
+ uint32_t flags);
+NTSTATUS socket_connect_complete(struct socket_context *sock, uint32_t flags);
+NTSTATUS socket_listen(struct socket_context *sock, const char *my_address, int port, int queue_size, uint32_t flags);
+NTSTATUS socket_accept(struct socket_context *sock, struct socket_context **new_sock);
+NTSTATUS socket_recv(struct socket_context *sock, void *buf,
+ size_t wantlen, size_t *nread, uint32_t flags);
+NTSTATUS socket_recvfrom(struct socket_context *sock, void *buf,
+ size_t wantlen, size_t *nread, uint32_t flags,
+ const char **src_addr, int *src_port);
+NTSTATUS socket_send(struct socket_context *sock,
+ const DATA_BLOB *blob, size_t *sendlen, uint32_t flags);
+NTSTATUS socket_sendto(struct socket_context *sock,
+ const DATA_BLOB *blob, size_t *sendlen, uint32_t flags,
+ const char *dest_addr, int dest_port);
+NTSTATUS socket_set_option(struct socket_context *sock, const char *option, const char *val);
+char *socket_get_peer_name(struct socket_context *sock, TALLOC_CTX *mem_ctx);
+char *socket_get_peer_addr(struct socket_context *sock, TALLOC_CTX *mem_ctx);
+int socket_get_peer_port(struct socket_context *sock);
+char *socket_get_my_addr(struct socket_context *sock, TALLOC_CTX *mem_ctx);
+int socket_get_my_port(struct socket_context *sock);
+int socket_get_fd(struct socket_context *sock);
+NTSTATUS socket_dup(struct socket_context *sock);
+const struct socket_ops *socket_getops_byname(const char *name, enum socket_type type);
+BOOL socket_check_access(struct socket_context *sock,
+ const char *service_name,
+ const char **allow_list, const char **deny_list);
+
#endif /* _SAMBA_SOCKET_H */
#include "includes.h"
#include "system/network.h"
#include "system/filesys.h"
+#include "lib/socket/socket.h"
static NTSTATUS ipv4_init(struct socket_context *sock)
{
*/
#include "includes.h"
+#include "lib/socket/socket.h"
#include "system/network.h"
#include "system/filesys.h"
*/
#include "includes.h"
+#include "lib/socket/socket.h"
+#include "lib/socket/socket.h"
#include "system/network.h"
#include "system/filesys.h"
#include "lib/events/events.h"
#include "dlinklist.h"
#include "libcli/nbt/libnbt.h"
+#include "lib/socket/socket.h"
#define NBT_MAX_PACKET_SIZE 2048
#define NBT_MAX_REPLIES 1000
#include "lib/events/events.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
+#include "lib/socket/socket.h"
/*
this private structure is used during async connection handling
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "lib/socket/socket.h"
#include "system/time.h"
#include "dlinklist.h"
#include "lib/events/events.h"
#include "dlinklist.h"
#include "lib/events/events.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
+#include "lib/socket/socket.h"
#define MIN_HDR_SIZE 16
#include "dlinklist.h"
#include "nbt_server/nbt_server.h"
#include "smbd/service_task.h"
+#include "lib/socket/socket.h"
/*
*/
#include "includes.h"
+#include "lib/socket/socket.h"
#include "system/filesys.h"
#include "lib/events/events.h"
#include "rpc_server/dcerpc_server.h"
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include "lib/socket/socket.h"
+
/* modules can use the following to determine if the interface has changed
* please increment the version number after each interface change
* with a comment and maybe update struct process_model_critical_sizes.
#include "includes.h"
#include "process_model.h"
#include "lib/events/events.h"
+#include "lib/socket/socket.h"
#include "smbd/service_stream.h"
/* the range of ports to try for dcerpc over tcp endpoints */
*/
#include "includes.h"
+#include "lib/socket/socket.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
#include "includes.h"
#include "libcli/nbt/libnbt.h"
#include "librpc/gen_ndr/ndr_nbt.h"
+#include "lib/socket/socket.h"
#define CHECK_VALUE(v, correct) do { \
if ((v) != (correct)) { \
#include "includes.h"
#include "libcli/nbt/libnbt.h"
#include "librpc/gen_ndr/ndr_nbt.h"
+#include "lib/socket/socket.h"
#define CHECK_VALUE(v, correct) do { \
if ((v) != (correct)) { \
#include "libcli/nbt/libnbt.h"
#include "lib/cmdline/popt_common.h"
#include "system/iconv.h"
+#include "lib/socket/socket.h"
/* command line options */
static struct {
*/
#include "includes.h"
+#include "lib/socket/socket.h"
#include "system/filesys.h"
#include "dlinklist.h"
#include "lib/events/events.h"