radsecproxy-1.6.5.
[radsecproxy.git] / hostport.h
1 /*
2  * Copyright (C) 2006-2009 Stig Venaas <venaas@uninett.no>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  */
8
9 struct hostportres {
10     char *host;
11     char *port;
12     uint8_t prefixlen;
13     struct addrinfo *addrinfo;
14 };
15
16 struct hostportres *newhostport(char *hostport, char *default_port, uint8_t prefixok);
17 int addhostport(struct list **hostports, char **hostport, char *portdefault, uint8_t prefixok);
18 void freehostport(struct hostportres *hp);
19 void freehostports(struct list *hostports);
20 int resolvehostport(struct hostportres *hp, int af, int socktype, uint8_t passive);
21 int resolvehostports(struct list *hostports, int af, int socktype);
22 struct addrinfo *resolvepassiveaddrinfo(char *hostport, int af, char *default_port, int socktype);
23 int addressmatches(struct list *hostports, struct sockaddr *addr, uint8_t checkport);
24 int connecttcphostlist(struct list *hostports,  struct addrinfo *src);
25
26 /* Local Variables: */
27 /* c-file-style: "stroustrup" */
28 /* End: */