From owner-freebsd-ports Fri Oct 16 09:48:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA22343 for freebsd-ports-outgoing; Fri, 16 Oct 1998 09:48:13 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from freebsd.ntu.edu.tw (freebsd.ntu.edu.tw [140.112.1.3]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id JAA22173 for ; Fri, 16 Oct 1998 09:47:32 -0700 (PDT) (envelope-from woju@freebsd.ntu.edu.tw) From: woju@freebsd.ntu.edu.tw Received: (qmail 12868 invoked by uid 9999); 16 Oct 1998 16:56:49 -0000 Date: 16 Oct 1998 16:56:49 -0000 Message-ID: <19981016165649.12867.qmail@freebsd.ntu.edu.tw> Reply-To: woju@freebsd.ntu.edu.tw To: freebsd-ports@FreeBSD.ORG Subject: [help] determin local ouput ip X-Disclaimer: FreeBSD 俱樂部對本信內容恕不負責。 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi: A problem is encounted while porting "queso". (ports/8305) ftp://freebsd.ntu.edu.tw/freebsd/woju/ports/queso.tgz How to determin local ip without establishing a connection? My ports now use the method like /usr/share/examples/find_interface/. After reporting this port to savage(queso's author), he said "queso determines remote OS without establishing connections". In file queso-980922/tcpip.c -- getlocalip (unsigned long dest) { static struct in_addr ina; #ifdef LINUX /*---------------------------------------------- LINUX --*/ int i; for (i = 0; i < numroutes; i++) { if ((dest & routes[i].naddr) == (unsigned long) routes[i].addr.s_addr) { return (routes[i].iface->addr); } } #else /* !LINUX ---------------------------------------------- OTHER --*/ My ports -- #elif defined(__FreeBSD__) /*------------------------------- FreeBSD --*/ /* Ref: /usr/share/examples/find_interface/ */ If anybody know some other way to determine output IP, please let me know. Thanks. - woju ( FreeBSD Chinese BIG5 Document/FAQ http://bsd.wj.ml.org ) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message