1/*
2 * Copyright (c) 1997-1999 Kungliga Tekniska H�gskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 19 unchanged lines hidden (view full) ---
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#include "krb5_locl.h"
35
36RCSID("$Id: addr_families.c,v 1.22 1999/12/04 17:53:33 assar Exp $");
37
38struct addr_operations {
39 int af;
40 krb5_address_type atype;
41 size_t max_sockaddr_size;
42 krb5_error_code (*sockaddr2addr)(const struct sockaddr *, krb5_address *);
43 krb5_error_code (*sockaddr2port)(const struct sockaddr *, int16_t *);
44 void (*addr2sockaddr)(const krb5_address *, struct sockaddr *,
--- 482 unchanged lines hidden (view full) ---
527
528 n = 0;
529 for (a = ai; a != NULL; a = a->ai_next)
530 ++n;
531
532 ALLOC_SEQ(addresses, n);
533
534 for (a = ai, i = 0; a != NULL; a = a->ai_next, ++i) {
535 struct addr_operations *aop = find_af (ai->ai_family);
536
537 addresses->val[i].addr_type = aop->atype;
538 krb5_data_copy (&addresses->val[i].address,
539 ai->ai_addr,
540 ai->ai_addrlen);
541 }
542 freeaddrinfo (ai);
543 return 0;
544}
2 * Copyright (c) 1997-1999 Kungliga Tekniska H�gskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 19 unchanged lines hidden (view full) ---
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#include "krb5_locl.h"
35
36RCSID("$Id: addr_families.c,v 1.22 1999/12/04 17:53:33 assar Exp $");
37
38struct addr_operations {
39 int af;
40 krb5_address_type atype;
41 size_t max_sockaddr_size;
42 krb5_error_code (*sockaddr2addr)(const struct sockaddr *, krb5_address *);
43 krb5_error_code (*sockaddr2port)(const struct sockaddr *, int16_t *);
44 void (*addr2sockaddr)(const krb5_address *, struct sockaddr *,
--- 482 unchanged lines hidden (view full) ---
527
528 n = 0;
529 for (a = ai; a != NULL; a = a->ai_next)
530 ++n;
531
532 ALLOC_SEQ(addresses, n);
533
534 for (a = ai, i = 0; a != NULL; a = a->ai_next, ++i) {
535 struct addr_operations *aop = find_af (ai->ai_family);
536
537 addresses->val[i].addr_type = aop->atype;
538 krb5_data_copy (&addresses->val[i].address,
539 ai->ai_addr,
540 ai->ai_addrlen);
541 }
542 freeaddrinfo (ai);
543 return 0;
544}