1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
Commit Graph

46 Commits

Author SHA1 Message Date
Matthew Grant
f39a06de3b lib/tsocket: new function to parse host port strs.
tsocket_address_inet_from_hostport_strings() on top of
tsocket_address_inet_from_strings(), implementing the ability to parse a
port number appended to an IPv6 or IPv4 address. IPv6 addresses can also
optionally have square brackets around them, but these are needed to
specify the port number as colon is used to delimit port from the IP
address in the string.

Note that this code just recognises and parses the strings with port
given, or just IPv6 with square brackets.  The rest of the parsing is
passed on to tsocket_address_inet_from strings(), and errors from there
passed back up the stack.

Signed-off-by: Matthew Grant <grantma@mattgrant.net.nz>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-09-28 09:44:35 +00:00
Peter Eriksson
b29e6480dc Rename macro argument s_addr due to it already being defined
Signed-off-by: Peter Eriksson <pen@lysator.liu.se>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-02-28 03:08:45 +00:00
Mathieu Parent
d6525485df Spelling fixes s/implentation/implementation/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-09-01 22:21:28 +00:00
Samuel Cabrero
8cb921d255 lib:tsocket: New function to build a tsocket_context from samba_address
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:14 +00:00
Volker Lendecke
9d4bf6bb9d tsocket: Simplify tsocket.h
tevent.h already includes talloc.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-03-22 18:02:17 +00:00
Andreas Schneider
8a313bbdd5 lib:tsocket: Check for DOXYGEN as a #define
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>

Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon Dec 17 00:10:10 CET 2018 on sn-devel-144
2018-12-17 00:10:10 +01:00
Volker Lendecke
f7f15c25d2 tsocket: Fix typos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-04 00:37:20 +01:00
Stefan Metzmacher
36b97d0bb9 lib/tsocket: add tdgram_inet_udp_broadcast_socket()
This is similar to tdgram_inet_udp_socket(), but it allows
the use of ipv4 broadcast traffic.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-12 17:08:17 +02:00
Stefan Metzmacher
3a8b7b0518 lib/tsocket: add tdgram_bsd_existing_socket() helper function
This is similar to tstream_bsd_existing_socket().
Both help to migrate strange code path to using the tstream or tdgram
abstractions.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-12 17:08:17 +02:00
Volker Lendecke
fffb70168d tsocket: Add some const
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-06-14 20:30:33 +02:00
Stefan Metzmacher
e42889f83f lib/tsocket: disable the syscall optimization for recvfrom/readv by default
We only do the optimization on recvfrom/readv if the caller asked for it.

This is needed because in most cases we preferr to flush send
buffers before receiving incoming requests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-11-05 17:13:39 +01:00
Stefan Metzmacher
79c6572256 tsocket: let tstream_inet_tcp_connect_recv() optionally return the used local address
tstream_inet_tcp_connect_send() usually only gets no local port number
and it may use the wildcard address '0.0.0.0' or '::'.

tstream_inet_tcp_connect_recv() provides the used local address and port
which are used on the wire.

metze
2010-10-23 08:49:30 +02:00
Stefan Metzmacher
8494d09b89 Revert "lib/tsocket: sa_socklen is a macro on irix, so better use sasocklen"
This reverts commit 3d4fb698660381e650d7caeb5b7cff12847c0fb8.

This was wrong... The problem was in the caller, sa_len is a macro on irix

metze
2010-08-28 08:28:01 +02:00
Stefan Metzmacher
44b2a7941c lib/tsocket: sa_socklen is a macro on irix, so better use sasocklen
metze
2010-08-27 13:00:26 +02:00
Volker Lendecke
f94039a8ea s3: Fix a typo 2010-08-15 09:45:30 +02:00
Andreas Schneider
04327e2809 tsocket: Added the warning again to tsocket_address_bsd_sockaddr. 2010-05-05 09:25:21 +02:00
Andreas Schneider
fcb53828df tsocket: Fixed the documentation of tsocket_address_bsd_sockaddr. 2010-05-03 15:55:34 +02:00
Stefan Metzmacher
2436ec2928 lib/tsocket: add tsocket_address_is_unix() function
metze
2010-04-27 13:00:24 +02:00
Stefan Metzmacher
e1596bbf27 lib/tsocket: add tsocket_address_is_inet() function
metze
2010-04-27 13:00:24 +02:00
Andreas Schneider
1983256c70 tsocket: Improve the tsocket_address_bsd_sockaddr documentation.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-26 08:57:30 +01:00
Brad Hards
319d3bf9d9 Spelling fixes for tsocket API documentation.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:33 +01:00
Kai Blin
88099bcc93 tsocket: Fix the description of tstream_writev_queue_send/recv 2010-01-28 11:16:24 +01:00
Kai Blin
9184f524f0 tsocket: Fix description for tstream_readv_pdu_queue_send/recv 2010-01-28 11:11:33 +01:00
Andreas Schneider
574f77f89e tsocket: Added complete doxygen documentation.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-01-11 11:22:59 +01:00
Andreas Schneider
ab04dd3be7 tsocket: Fixed typo in LGPL header. 2009-12-15 23:34:22 +01:00
Stefan Metzmacher
edbf2caa6f tsocket: add tsocket_address_bsd_sockaddr() and tsocket_address_bsd_from_sockaddr()
metze
2009-12-15 23:34:22 +01:00
Stefan Metzmacher
9b5d1e9e35 tsocket: remove prototype of non-existing tsocket_address_inet_set_broadcast()
metze
2009-11-03 18:14:23 +01:00
Stefan Metzmacher
6ac61e6707 tsocket: add tstream_readv_pdu_queue_send/recv()
metze
2009-05-01 17:42:01 +02:00
Stefan Metzmacher
eb723c2061 tsocket: add tstream_writev_queue_send/recv()
metze
2009-05-01 17:42:00 +02:00
Stefan Metzmacher
a0830f4cb9 tsocket: add tstream_readv_pdu_send/recv()
metze
2009-05-01 17:41:56 +02:00
Stefan Metzmacher
ee6d796c19 tsocket: add tstream implementation for bsd sockets (inet and unix)
metze
2009-05-01 17:41:55 +02:00
Stefan Metzmacher
8a090c4b8b tsocket: add tstream_context infrastructure similar to tdgram_context
metze
2009-05-01 17:41:53 +02:00
Stefan Metzmacher
182a4b30de tsocket: rename tdgram_unix_dgram_socket() => tdgram_unix_socket()
metze
2009-05-01 17:41:38 +02:00
Stefan Metzmacher
9dbb535aa5 tsocket: remove tsocket_context related stuff
It will be replaced by tdgram_context and tstream_context.

metze
2009-05-01 17:38:21 +02:00
Stefan Metzmacher
3bbad34a02 tsocket: remove DGRAM support from tsocket_context
metze
2009-04-02 21:54:08 +02:00
Stefan Metzmacher
85742dbc06 tsocket: add tdgram_sendto_queue_send/recv()
metze
2009-04-02 21:53:59 +02:00
Stefan Metzmacher
8d98070a9f tsocket: split out a smaller tdgram_context abstraction
The idea is to have a tdgram and a tstream abstraction
which only provide tevent_req based io functions.

metze
2009-04-02 21:53:03 +02:00
Stefan Metzmacher
a27c6eb8e2 lib/tsocket: add tsocket_readv_send/recv()
metze
2009-03-19 16:25:56 +01:00
Stefan Metzmacher
6c8bd1005d lib/tsocket: add tsocket_writev_queue_send/recv()
metze
2009-03-19 16:25:55 +01:00
Stefan Metzmacher
2e44ceaea8 lib/tsocket: add tsocket_writev_send/recv()
metze
2009-03-19 16:25:55 +01:00
Stefan Metzmacher
a140823cc9 lib/tsocket: add tsocket_connect_send/recv()
metze
2009-03-19 16:25:54 +01:00
Stefan Metzmacher
4002b7bdc1 lib/tsocket: add tsocket_sendto_queue_send/recv()
metze
2009-03-19 16:25:54 +01:00
Stefan Metzmacher
9ed7a45c88 lib/tsocket: add tsocket_sendto_send/recv()
metze
2009-03-19 16:25:54 +01:00
Stefan Metzmacher
ccfd6a6e39 lib/tsocket: add tsocket_recvfrom_send/recv()
metze
2009-03-19 16:25:53 +01:00
Stefan Metzmacher
6c88d61bdd lib/tsocket: add an implementation for bsd style sockets.
metze
2009-03-19 16:25:53 +01:00
Stefan Metzmacher
2e0e416676 lib/tsocket: add generic socket abstraction layer
This will replace source4/lib/socket/.

metze
2009-03-19 15:01:12 +01:00