From 1066acd60cb512d1f1d708a43a37a4b833614f75 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 7 Dec 1994 00:34:41 +0000 Subject: [PATCH] doc --- src/ca/if_depen.c | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/src/ca/if_depen.c b/src/ca/if_depen.c index 6531454f5..2c18f35e0 100644 --- a/src/ca/if_depen.c +++ b/src/ca/if_depen.c @@ -54,6 +54,7 @@ static char *sccsId = "@(#) $Id$"; * * Perhaps it is sufficient for this to return 127.0.0.1 * (the loop back address) + * See Below */ int local_addr(int s, struct sockaddr_in *plcladdr) { @@ -141,16 +142,46 @@ int local_addr(int s, struct sockaddr_in *plcladdr) return OK; } + +#if 0 +/* + * An alternate sloution + * for os without the if routines + */ +/* + * local_addr() + * + * return 127.0.0.1 + * (the loop back address) + */ +int local_addr (int s, struct sockaddr_in *plcladdr) +{ + ca_uint32_t loopBackAddress = 0x7f000001; + + plcladdr->sa_family = AF_INET; + plcladdr->sin_port = 0; + plcladdr->sin_addr.s_addr = ntohl (loopBackAddress); +} +#endif + /* - * caDiscoverInterfaces() + * caDiscoverInterfaces() * - * Load the list with the broadcast address for all - * interfaces found that support broadcast. + * This routine is provided with the address of an ELLLIST a socket + * and a destination port number. When the routine returns there + * will be one additional inet address (a caAddrNode) in the list + * for each inet interface found that is up and isnt a loop back + * interface. If the interface supports broadcast then I add its + * broadcast address to the list. If the interface is a point to + * point link then I add the destination address of the point to + * point link to the list. In either case I set the port number + * in the address node to the port supplied in the argument + * list. * - * LOCK should be applied here for (pList) - * (this is also called from the server) + * LOCK should be applied here for (pList) + * (this is also called from the server) */ void caDiscoverInterfaces(ELLLIST *pList, int socket, int port) {