summaryrefslogtreecommitdiff
path: root/source4/rpc_server/dcerpc_server.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-12-13 23:25:15 +0000
committerAndrew Tridgell <tridge@samba.org>2003-12-13 23:25:15 +0000
commitd262b8c3c79b2fbb0bf8c330d765f89210948a26 (patch)
tree0492a6fa66101b94f5dc368480c2ab027e4f8b77 /source4/rpc_server/dcerpc_server.c
parent8d79eb52f104d023122de3965592b4ea36adbb2b (diff)
downloadsamba-d262b8c3c79b2fbb0bf8c330d765f89210948a26.tar.gz
samba-d262b8c3c79b2fbb0bf8c330d765f89210948a26.tar.bz2
samba-d262b8c3c79b2fbb0bf8c330d765f89210948a26.zip
completed the linkage between the endpoint mapper and the dcerpc
server endpoints. We can now successfully setup listening endpoints on high ports, then use our endpoint mapper redirect incoming clients to the right port. also greatly cleanup the rpc over tcp session handling. (This used to be commit 593bc29bbe0e46d356d001160e8a3332a88f2fa8)
Diffstat (limited to 'source4/rpc_server/dcerpc_server.c')
-rw-r--r--source4/rpc_server/dcerpc_server.c43
1 files changed, 36 insertions, 7 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index bde7063dcc..4493ffdaa5 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -55,15 +55,44 @@ static struct dcesrv_call_state *dcesrv_find_call(struct dcesrv_state *dce, uint
register an endpoint server
*/
BOOL dcesrv_endpoint_register(struct dcesrv_context *dce,
- const struct dcesrv_endpoint_ops *ops)
+ const struct dcesrv_endpoint_ops *ops,
+ const struct dcerpc_interface_table *table)
{
- struct dce_endpoint *ep;
- ep = malloc(sizeof(*ep));
- if (!ep) {
- return False;
+ BOOL done_smb=False;
+ BOOL done_tcp=False;
+ int i;
+
+ for (i=0;i<table->endpoints->count;i++) {
+ struct dce_endpoint *ep;
+ BOOL tcp;
+
+ tcp = (strncasecmp(table->endpoints->names[i], "TCP-", 4) == 0);
+
+ if (tcp) {
+ if (done_tcp) continue;
+ done_tcp = True;
+ } else {
+ if (done_smb) continue;
+ done_smb = True;
+ }
+
+ ep = malloc(sizeof(*ep));
+ if (!ep) {
+ return False;
+ }
+
+ if (tcp) {
+ ep->endpoint.type = ENDPOINT_TCP;
+ ep->endpoint.info.tcp_port = atoi(table->endpoints->names[i]+4);
+ } else {
+ ep->endpoint.type = ENDPOINT_SMB;
+ ep->endpoint.info.smb_pipe = table->endpoints->names[i];
+ }
+
+ ep->endpoint_ops = ops;
+ DLIST_ADD(dce->endpoint_list, ep);
}
- ep->endpoint_ops = ops;
- DLIST_ADD(dce->endpoint_list, ep);
+
return True;
}