author | Tero Marttila <terom@fixme.fi> |
Thu, 21 May 2009 16:57:56 +0300 | |
changeset 213 | f0e52e026197 |
parent 177 | a74b55104fb9 |
permissions | -rw-r--r-- |
177
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
1 |
#ifndef TCP_H |
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
2 |
#define TCP_H |
155
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
|
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
/** |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
* @file |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
* |
177
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
7 |
* TCP transport/service implementation. |
155
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
* |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
* XXX: provide some TCP-specific type/functions? |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
10 |
*/ |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
#include "transport.h" |
177
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
12 |
#include "service.h" |
155
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
13 |
|
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
14 |
/** |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
15 |
* Connect the given transport via TCP to the given host/service. The transport will not be ready for use until the |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
16 |
* transport_callbacks::on_connect callback has been invoked. |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
17 |
* |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
18 |
* XXX: blocking DNS resolution |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
19 |
* |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
20 |
* @param info the transport setup info |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
21 |
* @param transport_ptr returned transport |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
22 |
* @param host the hostname to connect to |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
23 |
* @param service the service name (i.e. port) to connect to |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
24 |
* @param err returned error info |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
25 |
*/ |
177
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
26 |
err_t tcp_connect (const struct transport_info *info, transport_t **transport_ptr, |
155
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
27 |
const char *host, const char *service, error_t *err); |
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
28 |
|
177
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
29 |
/** |
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
30 |
* Create a passive/listening TCP socket on the given interface/port (NULL to pick automatically). |
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
31 |
*/ |
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
32 |
err_t tcp_listen (const struct service_info *info, service_t **service_ptr, |
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
33 |
const char *interface, const char *service, error_t *err); |
a74b55104fb9
rename sock_tcp to tcp_{transport,client}, fix irc_net_connect to use log_err/tcp_connect
Tero Marttila <terom@fixme.fi>
parents:
169
diff
changeset
|
34 |
|
155
c59d3eaff0fb
most of the new transport/sock code compiles, but things are still missing
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
35 |
#endif |