summaryrefslogtreecommitdiff
path: root/include/mailutils/stream.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-11-01 10:56:08 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2017-11-01 10:56:08 +0200
commit4e7bcdbae346a26c1addf266a23c1f6cdc74533f (patch)
tree30f6721129f8a7688814b9dc88727e810770fbda /include/mailutils/stream.h
parenta5e929972db1342beec4b8f577399f2d8d9a76c2 (diff)
downloadmailutils-4e7bcdbae346a26c1addf266a23c1f6cdc74533f.tar.gz
mailutils-4e7bcdbae346a26c1addf266a23c1f6cdc74533f.tar.bz2
Improve socket and SMTP client API
Split formatting functions into two distinct families. Functions prefixed with mu_sys_sockadrr deal with struct sockaddr, wherease those starting with mu_sockaddr deal with struct mu_sockaddr. Introduce special format for SMTP EHLO. When sending EHLO to the remote party, use IP address in square brackets if hostname is empty. * libmailutils/sockaddr/Makefile.am (libsockaddr_la_SOURCES): Add fromsock.c * libmailutils/sockaddr/fromsock.c: New function. * libmailutils/sockaddr/str.c (mu_sockaddr_format): Rewrite. (mu_sys_sockaddr_format,mu_sys_sockaddr_to_astr): New functions. * include/mailutils/debug.h (mu_sockaddr_to_astr): Remove prototype. * include/mailutils/sockaddr.h (mu_sockaddr_format): New enum. (mu_sockaddr_format): change signature. (mu_sys_sockaddr_format,mu_sys_sockaddr_to_astr): New prototypes. (mu_sockaddr_from_socket): New prototype. * include/mailutils/stream.h (MU_IOCTL_TCPSTREAM): New ioctl family; (MU_IOCTL_TCP_GETSOCKNAME): New ioctl opcode. * comsat/comsat.c: Use mu_sys_sockaddr_ interface to handle struct sockaddr. * lib/tcpwrap.c: Likewise. * libmailutils/server/ipsrv.c: Likewise. * libmailutils/server/msrv.c: Likewise. * libmailutils/stream/tcp.c (_tcp_ioctl): Handle MU_IOCTL_TCPSTREAM. * libproto/mailer/smtp_ehlo.c (mu_smtp_ehlo): If hostname is empty, use IP address in square brackets.
Diffstat (limited to 'include/mailutils/stream.h')
-rw-r--r--include/mailutils/stream.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/mailutils/stream.h b/include/mailutils/stream.h
index 4e82b9239..53dce6f46 100644
--- a/include/mailutils/stream.h
+++ b/include/mailutils/stream.h
@@ -79,6 +79,7 @@ enum mu_buffer_type
*/
#define MU_IOCTL_TLSSTREAM 13 /* TLS stream */
#define MU_IOCTL_WORDWRAPSTREAM 14 /* Word-wrapper stream */
+#define MU_IOCTL_TCPSTREAM 15 /* TCP stream */
/* Opcodes common for various families */
#define MU_IOCTL_OP_GET 0
@@ -244,6 +245,14 @@ int mu_ioctl_logstream_set_locus_deprecated (void) MU_DEPRECATED;
/* Get current column */
#define MU_IOCTL_WORDWRAP_GET_COLUMN 4
+ /* TCP streams */
+
+ /* Get socket name.
+ Arg: struct mu_sockaddr **
+ */
+#define MU_IOCTL_TCP_GETSOCKNAME 0
+
+
struct mu_nullstream_pattern
{
char *pattern;

Return to:

Send suggestions and report system problems to the System administrator.