uint32_t last_call_id;
+ bool allow_incoming;
+
size_t num_secs;
struct db_context *secs;
tevent_req_defer_callback(req, ev);
tevent_req_set_cleanup_fn(req, dcerpc_server_connection_loop_cleanup);
+ state->allow_incoming = true;
//TODO different dcerpc_connection_dead() behavior as server?
return req;
tevent_req_data(req,
struct dcerpc_server_connection_loop_state);
+ state->allow_incoming = false;
+
if (state->conn != NULL) {
TALLOC_FREE(state->conn->calls.new_call);
state->conn = NULL;
tevent_req_data(req,
struct dcerpc_server_connection_loop_state);
+ if (!state->allow_incoming) {
+ DEBUG(0, ("Unexpected packet type %u received from %s!\n",
+ (unsigned int)pkt->ptype,
+ "TODO"));
+ return NT_STATUS_RPC_PROTOCOL_ERROR;
+ }
+
/* Ensure we have the correct type. */
switch (pkt->ptype) {
case DCERPC_PKT_BIND:
if (state->conn->features.bind_done) {
return NT_STATUS_RPC_PROTOCOL_ERROR;
}
+ state->allow_incoming = false;
+ // TODO...
+
state->conn->features.bind_done = true;
+ state->allow_incoming = true;
+ break;
+
+ case DCERPC_PKT_AUTH3:
+ if (!state->conn->features.bind_done) {
+ return NT_STATUS_RPC_PROTOCOL_ERROR;
+ }
+ // TODO...
+
break;
case DCERPC_PKT_ALTER:
if (!state->conn->features.bind_done) {
return NT_STATUS_RPC_PROTOCOL_ERROR;
}
+ // TODO...
+
break;
case DCERPC_PKT_REQUEST:
if (!state->conn->features.bind_done) {
return NT_STATUS_RPC_PROTOCOL_ERROR;
}
+ // TODO...
+
break;
+ case DCERPC_PKT_CO_CANCEL:
+ case DCERPC_PKT_ORPHANED:
+ // TODO...
default:
DEBUG(0, ("Unknown packet type %u received from %s!\n",
(unsigned int)pkt->ptype,