genaddrs.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* lib/krb5/os/genaddrs.c
*
* Copyright 1995 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
*
* Take an IP addr & port and generate a full IP address.
*/
#define NEED_SOCKETS
#include <k5-int.h>
#include "os-proto.h"
#if !defined(_WINSOCKAPI_) && !defined(HAVE_MACSOCK_H)
#endif
#ifndef GETPEERNAME_ARG2_TYPE
#define GETPEERNAME_ARG2_TYPE struct sockaddr
#endif
#ifndef GETPEERNAME_ARG3_TYPE
#define GETPEERNAME_ARG3_TYPE size_t
#endif
#ifndef GETSOCKNAME_ARG2_TYPE
#define GETSOCKNAME_ARG2_TYPE struct sockaddr
#endif
#ifndef GETSOCKNAME_ARG3_TYPE
#define GETSOCKNAME_ARG3_TYPE size_t
#endif
struct addrpair {
};
{
case AF_INET:
return a;
#ifdef KRB5_USE_INET6
case AF_INET6:
} else
return a;
#endif
default:
return 0;
}
}
{
#ifdef HAVE_NETINET_IN_H
ssize = sizeof(struct sockaddr_storage);
if ((flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR) ||
&ssize)))
return retval;
else
lport = 0;
} else
return KRB5_PROG_ATYPE_NOSUPP;
} else {
}
ssize = sizeof(struct sockaddr_storage);
if ((flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR) ||
&ssize)))
return errno;
else
rport = 0;
} else
return KRB5_PROG_ATYPE_NOSUPP;
} else {
}
return retval;
#else
return KRB5_PROG_ATYPE_NOSUPP;
#endif
}