diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-04-26 13:06:07 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-04-27 13:00:25 +0200 |
commit | c42bb8e49c77517729f9b57a81fd07815b5b493a (patch) | |
tree | 0fd711ee7d44a170a42253c305f110d4f7d7e69e /source4 | |
parent | ba703cb8e90070447dda46a3356f6a49b2fee537 (diff) | |
download | samba-c42bb8e49c77517729f9b57a81fd07815b5b493a.tar.gz samba-c42bb8e49c77517729f9b57a81fd07815b5b493a.tar.bz2 samba-c42bb8e49c77517729f9b57a81fd07815b5b493a.zip |
s4:rpc_server: remember the local and remote address
metze
Diffstat (limited to 'source4')
-rw-r--r-- | source4/rpc_server/dcerpc_server.c | 10 | ||||
-rw-r--r-- | source4/rpc_server/dcerpc_server.h | 5 | ||||
-rw-r--r-- | source4/rpc_server/service_rpc.c | 3 |
3 files changed, 18 insertions, 0 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index bc06c065da..c9474233cb 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -1139,6 +1139,16 @@ static int dcesrv_call_dequeue(struct dcesrv_call_state *call) return 0; } +_PUBLIC_ const struct tsocket_address *dcesrv_connection_get_local_address(struct dcesrv_connection *conn) +{ + return conn->local_address; +} + +_PUBLIC_ const struct tsocket_address *dcesrv_connection_get_remote_address(struct dcesrv_connection *conn) +{ + return conn->remote_address; +} + /* process some input to a dcerpc endpoint server. */ diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h index 0628730f26..7e82548395 100644 --- a/source4/rpc_server/dcerpc_server.h +++ b/source4/rpc_server/dcerpc_server.h @@ -224,6 +224,9 @@ struct dcesrv_connection { struct tstream_context *stream; struct tevent_queue *send_queue; + + const struct tsocket_address *local_address; + const struct tsocket_address *remote_address; }; @@ -334,6 +337,8 @@ struct dcesrv_handle *dcesrv_handle_fetch( struct socket_address *dcesrv_connection_get_my_addr(struct dcesrv_connection *conn, TALLOC_CTX *mem_ctx); struct socket_address *dcesrv_connection_get_peer_addr(struct dcesrv_connection *conn, TALLOC_CTX *mem_ctx); +const struct tsocket_address *dcesrv_connection_get_local_address(struct dcesrv_connection *conn); +const struct tsocket_address *dcesrv_connection_get_remote_address(struct dcesrv_connection *conn); NTSTATUS dcesrv_fetch_session_key(struct dcesrv_connection *p, DATA_BLOB *session_key); diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c index 6485d9ef97..0cc930ebc5 100644 --- a/source4/rpc_server/service_rpc.c +++ b/source4/rpc_server/service_rpc.c @@ -403,6 +403,9 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn) return; } + dcesrv_conn->local_address = srv_conn->local_address; + dcesrv_conn->remote_address = srv_conn->remote_address; + srv_conn->private_data = dcesrv_conn; irpc_add_name(srv_conn->msg_ctx, "rpc_server"); |