headers of Qremote functions for connection establishing
More...
#include <qdns.h>
#include <netinet/in.h>
Go to the source code of this file.
|
int | tryconn (struct ips *mx, const struct in6_addr *outip4, const struct in6_addr *outip6) |
|
int | connect_mx (struct ips *mx, const struct in6_addr *outip4, const struct in6_addr *outip6) |
| establish a connection to a MX More...
|
|
void | getmxlist (char *, struct ips **) |
|
headers of Qremote functions for connection establishing
int connect_mx |
( |
struct ips * |
mx, |
|
|
const struct in6_addr * |
outip4, |
|
|
const struct in6_addr * |
outip6 |
|
) |
| |
establish a connection to a MX
- Parameters
-
mx | list of MX ips |
outip4 | address to use when making outgoing IPv4 connections |
outip6 | address to use when making outgoing IPv6 connections |
- Returns
- if the connection was established
- Return values
-
0 | a connection has been set up |
-ENOENT | no IPs were left to try |
This will return once a connection to a remote host has been successfully established and the greeting of the remote server has been parsed. If no connection can be made this function return -ENOENT.
void getmxlist |
( |
char * |
remhost, |
|
|
struct ips ** |
mx |
|
) |
| |
get all IPs for the MX entries of target address
- Parameters
-
remhost | target address |
mx | list of MX entries will be stored here, memory will be malloced |
int tryconn |
( |
struct ips * |
mx, |
|
|
const struct in6_addr * |
outip4, |
|
|
const struct in6_addr * |
outip6 |
|
) |
| |
try to estabish an SMTP connection to one of the hosts in the ip list
- Parameters
-
mx | list of IP adresses to try |
outip4 | local IPv4 to bind |
outip6 | local IPv6 to bind |
- Returns
- the socket descriptor of the open connection
- Return values
-
-ENOENT | no IP address left to connect to |
Every entry where a connection attempt was made is marked with a priority of MX_PRIORITY_USED, the last one tried with MX_PRIORITY_CURRENT.
the port on the destination host to connect to