*/
typedef struct _prs_struct {
- BOOL io; /* parsing in or out of data stream */
+ bool io; /* parsing in or out of data stream */
/*
* If the (incoming) data is big-endian. On output we are
* always little-endian.
*/
- BOOL bigendian_data;
+ bool bigendian_data;
uint8 align; /* data alignment */
- BOOL is_dynamic; /* Do we own this memory or not ? */
+ bool is_dynamic; /* Do we own this memory or not ? */
uint32 data_offset; /* Current working offset into data. */
uint32 buffer_size; /* Current allocated size of the buffer. */
uint32 grow_size; /* size requested via prs_grow() calls */
/* Domain controller authentication protocol info */
struct dcinfo {
uint32 sequence; /* "timestamp" from client. */
- DOM_CHAL seed_chal;
- DOM_CHAL clnt_chal; /* Client credential */
- DOM_CHAL srv_chal; /* Server credential */
+ struct netr_Credential seed_chal;
+ struct netr_Credential clnt_chal; /* Client credential */
+ struct netr_Credential srv_chal; /* Server credential */
unsigned char sess_key[16]; /* Session key - 8 bytes followed by 8 zero bytes */
unsigned char mach_pw[16]; /* md4(machine password) */
fstring remote_machine; /* Machine name we've authenticated. */
fstring domain;
- BOOL challenge_sent;
- BOOL authenticated;
+ bool challenge_sent;
+ bool authenticated;
};
typedef struct pipe_rpc_fns {
/* RPC function table associated with the current rpc_bind (associated by context) */
- struct api_struct *cmds;
+ const struct api_struct *cmds;
int n_cmds;
uint32 context_id;
typedef struct pipes_struct {
struct pipes_struct *next, *prev;
- connection_struct *conn;
- uint16 vuid; /* points to the unauthenticated user that opened this pipe. */
+ char client_address[INET6_ADDRSTRLEN];
+
+ struct auth_serversupplied_info *server_info;
fstring name;
fstring pipe_srv_name;
RPC_HDR hdr; /* Incoming RPC header. */
RPC_HDR_REQ hdr_req; /* Incoming request header. */
- /* This context is used for pipe state storage and is freed when the pipe is closed. */
- TALLOC_CTX *pipe_state_mem_ctx;
-
struct pipe_auth_data auth;
struct dcinfo *dc; /* Keeps the creds data from netlogon. */
/*
- * Credentials used for the pipe operations
+ * Unix user name and credentials used when a pipe is authenticated.
*/
struct current_user pipe_user;
- DATA_BLOB session_key;
/*
* Set to true when an RPC bind has been done on this pipe.
*/
- BOOL pipe_bound;
+ bool pipe_bound;
/*
* Set to true when we should return fault PDU's for everything.
*/
- BOOL fault_state;
+ bool fault_state;
/*
* Set to true when we should return fault PDU's for a bad handle.
*/
- BOOL bad_handle_fault_state;
+ bool bad_handle_fault_state;
/*
* Set to true when the backend does not support a call.
*/
- BOOL rng_fault_state;
+ bool rng_fault_state;
/*
* Set to RPC_BIG_ENDIAN when dealing with big-endian PDU's
*/
- BOOL endian;
+ bool endian;
/*
* Struct to deal with multiple pdu inputs.
int pnum;
connection_struct *conn;
uint16 vuid; /* points to the unauthenticated user that opened this pipe. */
- BOOL open; /* open connection */
+ bool open; /* open connection */
uint16 device_state;
uint16 priority;
- fstring name;
+ char *name;
/* When replying to an SMBtrans, this is the maximum amount of
data that can be sent in the initial reply. */
/*
* NamedPipe state information.
- *
- * (e.g. typecast a np_struct, above).
*/
- void *np_state;
+ struct pipes_struct *np_state;
/*
* NamedPipe functions, to be called to perform
* returns: state information representing the connection.
* is stored in np_state, above.
*/
- void * (*namedpipe_create)(const char *pipe_name,
- connection_struct *conn, uint16 vuid);
-
- /* call to perform a write / read namedpipe transaction.
- * TransactNamedPipe is weird: it returns whether there
- * is more data outstanding to be read, and the
- * caller is expected to take note and follow up with
- * read requests.
- */
- ssize_t (*namedpipe_transact)(void *np_state,
- char *data, int len,
- char *rdata, int rlen,
- BOOL *pipe_outstanding);
+ struct pipes_struct *(*namedpipe_create)(
+ const char *pipe_name,
+ const char *client_address,
+ struct auth_serversupplied_info *server_info,
+ uint16_t vuid);
/* call to perform a write namedpipe operation
*/
- ssize_t (*namedpipe_write)(void * np_state,
- char *data, size_t n);
+ ssize_t (*namedpipe_write)(struct pipes_struct *p,
+ char *data, size_t n);
/* call to perform a read namedpipe operation.
*
* when samba is modified to use namedpipe_transact,
* the pipe_outstanding argument may be removed.
*/
- ssize_t (*namedpipe_read)(void * np_state,
- char *data, size_t max_len,
- BOOL *pipe_outstanding);
-
- /* call to close a namedpipe.
- * function is expected to perform all cleanups
- * necessary, free all memory etc.
- *
- * returns True if cleanup was successful (not that
- * we particularly care).
- */
- BOOL (*namedpipe_close)(void * np_state);
+ ssize_t (*namedpipe_read)(struct pipes_struct *p,
+ char *data, size_t max_len,
+ bool *pipe_outstanding);
} smb_np_struct;
struct api_struct {
const char *name;
uint8 opnum;
- BOOL (*fn) (pipes_struct *);
+ bool (*fn) (pipes_struct *);
};
typedef struct {