diff options
author | Volker Lendecke <vl@samba.org> | 2018-01-16 16:21:08 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2018-01-24 05:48:19 +0100 |
commit | 7ea5d38a69660bf5e086ff03d18b4a4e9eb75cce (patch) | |
tree | 569db569b29476fc0ffe35a903456dfda149d61a /source3/libsmb/nmblib.c | |
parent | 6a60970306df44ff5676c98899069f867ac77d36 (diff) | |
download | samba-7ea5d38a69660bf5e086ff03d18b4a4e9eb75cce.tar.gz |
libnmb: Move "read_packet" to nmbd
It's only used there
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 24 05:48:19 CET 2018 on sn-devel-144
Diffstat (limited to 'source3/libsmb/nmblib.c')
-rw-r--r-- | source3/libsmb/nmblib.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c index c262c2820e2..bac43400b3a 100644 --- a/source3/libsmb/nmblib.c +++ b/source3/libsmb/nmblib.c @@ -875,41 +875,6 @@ struct packet_struct *parse_packet_talloc(TALLOC_CTX *mem_ctx, } /******************************************************************* - Read a packet from a socket and parse it, returning a packet ready - to be used or put on the queue. This assumes a UDP socket. -******************************************************************/ - -struct packet_struct *read_packet(int fd,enum packet_type packet_type) -{ - struct packet_struct *packet; - struct sockaddr_storage sa; - struct sockaddr_in *si = (struct sockaddr_in *)&sa; - char buf[MAX_DGRAM_SIZE]; - int length; - - length = read_udp_v4_socket(fd,buf,sizeof(buf),&sa); - if (length < MIN_DGRAM_SIZE || sa.ss_family != AF_INET) { - return NULL; - } - - packet = parse_packet(buf, - length, - packet_type, - si->sin_addr, - ntohs(si->sin_port)); - if (!packet) - return NULL; - - packet->recv_fd = fd; - packet->send_fd = -1; - - DEBUG(5,("Received a packet of len %d from (%s) port %d\n", - length, inet_ntoa(packet->ip), packet->port ) ); - - return(packet); -} - -/******************************************************************* Send a udp packet on a already open socket. ******************************************************************/ |