Return-Path: Delivered-To: apmail-ws-axis-cvs-archive@www.apache.org Received: (qmail 7875 invoked from network); 2 May 2006 10:24:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 May 2006 10:24:08 -0000 Received: (qmail 61301 invoked by uid 500); 2 May 2006 10:23:36 -0000 Delivered-To: apmail-ws-axis-cvs-archive@ws.apache.org Received: (qmail 61086 invoked by uid 500); 2 May 2006 10:23:35 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 61074 invoked by uid 500); 2 May 2006 10:23:35 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 61066 invoked by uid 99); 2 May 2006 10:23:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 May 2006 03:23:34 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 02 May 2006 03:23:34 -0700 Received: (qmail 7488 invoked by uid 65534); 2 May 2006 10:23:08 -0000 Message-ID: <20060502102308.7487.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r398891 - in /webservices/axis2/trunk/c: configure.ac include/platforms/unix/axis2_unix.h modules/platforms/unix/uuid_gen_unix.c Date: Tue, 02 May 2006 10:23:07 -0000 To: axis2-cvs@ws.apache.org From: sahan@apache.org X-Mailer: svnmailer-1.0.8 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sahan Date: Tue May 2 03:23:02 2006 New Revision: 398891 URL: http://svn.apache.org/viewcvs?rev=398891&view=rev Log: patch applied for AXIS2C-142 Modified: webservices/axis2/trunk/c/configure.ac webservices/axis2/trunk/c/include/platforms/unix/axis2_unix.h webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c Modified: webservices/axis2/trunk/c/configure.ac URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/configure.ac?rev=398891&r1=398890&r2=398891&view=diff ============================================================================== --- webservices/axis2/trunk/c/configure.ac (original) +++ webservices/axis2/trunk/c/configure.ac Tue May 2 03:23:02 2006 @@ -31,6 +31,10 @@ dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdio.h stdlib.h string.h]) +AC_CHECK_HEADERS([linux/if.h],[],[], +[ +#include +]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST Modified: webservices/axis2/trunk/c/include/platforms/unix/axis2_unix.h URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/platforms/unix/axis2_unix.h?rev=398891&r1=398890&r2=398891&view=diff ============================================================================== --- webservices/axis2/trunk/c/include/platforms/unix/axis2_unix.h (original) +++ webservices/axis2/trunk/c/include/platforms/unix/axis2_unix.h Tue May 2 03:23:02 2006 @@ -118,7 +118,6 @@ #include #include #include -#include /* dir handling */ #include Modified: webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c?rev=398891&r1=398890&r2=398891&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c (original) +++ webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c Tue May 2 03:23:02 2006 @@ -13,7 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#include + #include +#include #include #include #include @@ -21,8 +25,18 @@ #include #include #include -#include #include + +#ifdef HAVE_LINUX_IF_H +#include +#else +#if 1 /* this should be HAVE_NET_IF_H && SMELLS_LIKE_SOLARIS */ +#include +#include +#include +#endif +#endif + #include #include @@ -182,6 +196,7 @@ return uuid_str; } +#ifdef HAVE_LINUX_IF_H char * AXIS2_CALL axis2_uuid_get_mac_addr() { @@ -208,3 +223,71 @@ close(s); return buffer; } + +#else +/* code modified from that posted on: + * http://forum.sun.com/jive/thread.jspa?threadID=84804&tstart=30 + */ +char * AXIS2_CALL +axis2_uuid_get_mac_addr() +{ + unsigned char eth_addr[6]; + int sock; + int i; + struct lifconf lic; + struct lifreq *lifrs; + struct lifnum num; + + /* How many interfaces do we have? */ + sock=socket(PF_INET,SOCK_DGRAM,IPPROTO_IP); + num.lifn_family=AF_INET; + num.lifn_flags=0; + ioctl(sock,SIOCGLIFNUM,&num); + + /* get details of the interfaces */ + lifrs = malloc( (num.lifn_count + 1) * sizeof(*lifrs)); + if (NULL == lifrs) { + exit(1); /* what is the right error handling here ? */ + } + lic.lifc_family=AF_INET; + lic.lifc_flags=0; + lic.lifc_len=sizeof(lifrs); + lic.lifc_buf=(caddr_t)lifrs; + ioctl(sock,SIOCGLIFCONF,&lic); + + /* Get the ethernet address for each of them */ + for(i=0;i