diff options
author | Luke Leighton <lkcl@samba.org> | 1999-12-04 19:14:37 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-12-04 19:14:37 +0000 |
commit | d923bc8da2cf996408194d98381409191dd81a16 (patch) | |
tree | 916b7cf8cd4b997136b801a4da10c616e0f1b3d2 /source/utils/nmblookup.c | |
parent | 06390e792cd8aa57a91c3a3d1d267fd1bcdc17a1 (diff) | |
download | samba-d923bc8da2cf996408194d98381409191dd81a16.tar.gz samba-d923bc8da2cf996408194d98381409191dd81a16.tar.xz samba-d923bc8da2cf996408194d98381409191dd81a16.zip |
jeremy is going to hate me for this.
created an "nmb-agent" utility that, yes: it connects to the 137 socket
and accepts unix socket connections which it redirects onto port 137.
it uses the name_trn_id field to filter requests to the correct
location.
name_query() and name_status() are the first victims to use this
feature (by specifying a file descriptor of -1).
Diffstat (limited to 'source/utils/nmblookup.c')
-rw-r--r-- | source/utils/nmblookup.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/source/utils/nmblookup.c b/source/utils/nmblookup.c index 23415a0ca68..f920106f753 100644 --- a/source/utils/nmblookup.c +++ b/source/utils/nmblookup.c @@ -33,24 +33,28 @@ extern struct in_addr ipzero; int ServerFD= -1; -int RootPort = 0; +BOOL RootPort = False; /**************************************************************************** open the socket communication **************************************************************************/ static BOOL open_sockets(void) { - ServerFD = open_socket_in( SOCK_DGRAM, - (RootPort ? 137 :0), - 3, - interpret_addr(lp_socket_address()) ); - - if (ServerFD == -1) - return(False); - - set_socket_options(ServerFD,"SO_BROADCAST"); + if (RootPort) + { + ServerFD = open_socket_in( SOCK_DGRAM, + 137, + 3, + interpret_addr(lp_socket_address()) ); + + if (ServerFD == -1) + { + return(False); + } + set_socket_options(ServerFD,"SO_BROADCAST"); DEBUG(3, ("Socket opened.\n")); + } return True; } @@ -152,7 +156,7 @@ int main(int argc,char *argv[]) pstrcpy(servicesf, optarg); break; case 'r': - RootPort = -1; + RootPort = True; break; case 'h': usage(); |