summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorChristopher R. Hertel (crh) <crh@samba.org>2012-02-14 21:51:35 -0600
committerSimo Sorce <idra@samba.org>2012-02-16 08:29:41 +0100
commitb5b204184aa6d0f14e7d3bd08322a98dc4f432e6 (patch)
tree61216abd884217599c4e489716fdb0e64e90b7d4 /source3/libsmb
parent95d3096f9881fcf7717c55d6f6281b799236fff7 (diff)
downloadsamba-b5b204184aa6d0f14e7d3bd08322a98dc4f432e6.tar.gz
samba-b5b204184aa6d0f14e7d3bd08322a98dc4f432e6.tar.bz2
samba-b5b204184aa6d0f14e7d3bd08322a98dc4f432e6.zip
Rename obscure defined constants.
Replaced the undescriptive SMB_PORT1 and SMB_PORT2 defined constants with the slightly more descriptive names NBT_SMB_PORT and TCP_SMB_PORT. Also replaced several hard-coded references to the well-known port numbers (139 and 445, respectively) as appropriate. Small changes to clarify some comments regarding the two transport types. Signed-off-by: Simo Sorce <idra@samba.org> Autobuild-User: Simo Sorce <idra@samba.org> Autobuild-Date: Thu Feb 16 08:29:41 CET 2012 on sn-devel-104
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/libsmb_server.c2
-rw-r--r--source3/libsmb/smbsock_connect.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index 570b7ae849..f5fcaea62b 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -420,7 +420,7 @@ SMBC_server_internal(TALLOC_CTX *ctx,
/*
* Try 139 first for IPC$
*/
- status = cli_connect_nb(server_n, NULL, 139, 0x20,
+ status = cli_connect_nb(server_n, NULL, NBT_SMB_PORT, 0x20,
smbc_getNetbiosName(context),
SMB_SIGNING_DEFAULT, flags, &c);
}
diff --git a/source3/libsmb/smbsock_connect.c b/source3/libsmb/smbsock_connect.c
index 1926445c10..d9d3b92c0e 100644
--- a/source3/libsmb/smbsock_connect.c
+++ b/source3/libsmb/smbsock_connect.c
@@ -191,7 +191,7 @@ static struct tevent_req *nb_connect_send(TALLOC_CTX *mem_ctx,
talloc_set_destructor(state, nb_connect_state_destructor);
- subreq = open_socket_out_send(state, ev, addr, 139, 5000);
+ subreq = open_socket_out_send(state, ev, addr, NBT_SMB_PORT, 5000);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
@@ -276,7 +276,7 @@ static void nb_connect_done(struct tevent_req *subreq)
make_nmb_name(&state->called, state->called_name, 0x20);
subreq = open_socket_out_send(state, state->ev, state->addr,
- 139, 5000);
+ NBT_SMB_PORT, 5000);
if (tevent_req_nomem(subreq, req)) {
return;
}
@@ -351,7 +351,7 @@ struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
talloc_set_destructor(state, smbsock_connect_state_destructor);
- if (port == 139) {
+ if (port == NBT_SMB_PORT) {
subreq = tevent_wakeup_send(state, ev, timeval_set(0, 0));
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
@@ -374,7 +374,7 @@ struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
* port==0, try both
*/
- state->req_445 = open_socket_out_send(state, ev, addr, 445, 5000);
+ state->req_445 = open_socket_out_send(state, ev, addr, TCP_SMB_PORT, 5000);
if (tevent_req_nomem(state->req_445, req)) {
return tevent_req_post(req, ev);
}
@@ -382,7 +382,7 @@ struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
req);
/*
- * After 5 msecs, fire the 139 request
+ * After 5 msecs, fire the 139 (NBT) request
*/
state->req_139 = tevent_wakeup_send(
state, ev, timeval_current_ofs(0, 5000));
@@ -445,14 +445,14 @@ static void smbsock_connect_connected(struct tevent_req *subreq)
status = open_socket_out_recv(subreq, &state->sock);
TALLOC_FREE(state->req_445);
unfinished_req = state->req_139;
- state->port = 445;
+ state->port = TCP_SMB_PORT;
} else if (subreq == state->req_139) {
status = nb_connect_recv(subreq, &state->sock);
TALLOC_FREE(state->req_139);
unfinished_req = state->req_445;
- state->port = 139;
+ state->port = NBT_SMB_PORT;
} else {
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);