]>
git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libstrongswan/networking/streams/stream_tcp.h
2 * Copyright (C) 2013 Martin Willi
4 * Copyright (C) secunet Security Networks AG
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * @defgroup stream_tcp stream_tcp
28 * Create a stream for TCP sockets.
30 * TCP URIs start with tcp://, followed by a hostname (FQDN or IP), followed
31 * by a colon separated port. A full TCP uri looks something like:
33 * tcp://srv.example.com:5555
35 * tcp://[fec2::1]:7654
37 * There is no default port, so a colon after tcp:// is mandatory.
39 * @param uri TCP socket specific URI, must start with "tcp://"
40 * @return stream instance, NULL on failure
42 stream_t
*stream_create_tcp(char *uri
);
45 * Helper function to parse a tcp:// URI to a sockaddr
48 * @param addr sockaddr, large enough for URI
49 * @return length of sockaddr, -1 on error
51 int stream_parse_uri_tcp(char *uri
, struct sockaddr
*addr
);
53 #endif /** STREAM_TCP_H_ @}*/