View | Details | Raw Unified | Return to bug 139201
Collapse All | Expand All

(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (Scorched3D-41.3-src.tar.gz) = 6bb47045abccaca1f775ff4cde8b3b5d
1
MD5 (Scorched3D-42.1-src.tar.gz) = e24867615568ef541a291a4813fcbdae
2
SHA256 (Scorched3D-41.3-src.tar.gz) = a606cc93674cb2acd55389e7c54b5389408c288369077d4270bd785e430b2b03
2
SHA256 (Scorched3D-42.1-src.tar.gz) = 884eccfed5fda58c140c4a593806c0c366a695660c47cdd4ea8d96189189106e
3
SIZE (Scorched3D-41.3-src.tar.gz) = 60672892
3
SIZE (Scorched3D-42.1-src.tar.gz) = 64491145
(-)Makefile (-4 / +4 lines)
Lines 3-15 Link Here
3
# Date created:				Jan 5, 2003
3
# Date created:				Jan 5, 2003
4
# Whom:					mdodd
4
# Whom:					mdodd
5
#
5
#
6
# $FreeBSD: ports/games/scorched3d/Makefile,v 1.43 2009/08/22 00:22:29 amdmi3 Exp $
6
# $FreeBSD$
7
7
8
PORTNAME=		scorched3d
8
PORTNAME=		scorched3d
9
PORTVERSION=		0.${SCORCH_VERSION}${SCORCH_REVISION}
9
PORTVERSION=		0.${SCORCH_VERSION}${SCORCH_REVISION}
10
PORTREVISION=		2
11
CATEGORIES=		games
10
CATEGORIES=		games
12
MASTER_SITES=		SF/${PORTNAME}/${PORTNAME}/Build%2041.3
11
MASTER_SITES=		SF/${PORTNAME}/${PORTNAME}/Version%20${SCORCH_VERSION}/
13
DISTNAME=		Scorched3D-${SCORCH_VERSION}-src
12
DISTNAME=		Scorched3D-${SCORCH_VERSION}-src
14
13
15
MAINTAINER=		ports@FreeBSD.org
14
MAINTAINER=		ports@FreeBSD.org
Lines 23-29 Link Here
23
			jpeg:${PORTSDIR}/graphics/jpeg \
22
			jpeg:${PORTSDIR}/graphics/jpeg \
24
			png:${PORTSDIR}/graphics/png
23
			png:${PORTSDIR}/graphics/png
25
24
26
SCORCH_VERSION=		41.3
25
SCORCH_VERSION=		42.1
27
26
28
.if defined(WITH_MYSQL)
27
.if defined(WITH_MYSQL)
29
USE_MYSQL=		yes
28
USE_MYSQL=		yes
Lines 36-41 Link Here
36
USE_PERL5=	yes
35
USE_PERL5=	yes
37
USE_WX=		2.4+
36
USE_WX=		2.4+
38
WX_CONF_ARGS=	absolute
37
WX_CONF_ARGS=	absolute
38
USE_DOS2UNIX=	mkinstalldirs
39
39
40
WRKSRC=			${WRKDIR}/scorched
40
WRKSRC=			${WRKDIR}/scorched
41
AUTOMAKE_ARGS=		--foreign
41
AUTOMAKE_ARGS=		--foreign
(-)pkg-plist (-8 / +39 lines)
Lines 136-145 Link Here
136
games/scorched3d/data/avatars/yoda.png
136
games/scorched3d/data/avatars/yoda.png
137
games/scorched3d/data/custominfo.xml
137
games/scorched3d/data/custominfo.xml
138
games/scorched3d/data/fastestdisplay.xml
138
games/scorched3d/data/fastestdisplay.xml
139
games/scorched3d/data/fonts/VERA-COPYRIGHT.TXT
139
games/scorched3d/data/fonts/dejavusans.ttf
140
games/scorched3d/data/fonts/test.ttf
140
games/scorched3d/data/fonts/dejavusconbd.ttf
141
games/scorched3d/data/fonts/vera.ttf
141
games/scorched3d/data/fonts/dejavusmobd.ttf
142
games/scorched3d/data/fonts/veramobd.ttf
143
games/scorched3d/data/globalmods/apoc/authors.txt
142
games/scorched3d/data/globalmods/apoc/authors.txt
144
games/scorched3d/data/globalmods/apoc/data/accessories.xml
143
games/scorched3d/data/globalmods/apoc/data/accessories.xml
145
games/scorched3d/data/globalmods/apoc/data/accessories/black.bmp
144
games/scorched3d/data/globalmods/apoc/data/accessories/black.bmp
Lines 623-628 Link Here
623
games/scorched3d/data/globalmods/apoc/readme-nexus.txt
622
games/scorched3d/data/globalmods/apoc/readme-nexus.txt
624
games/scorched3d/data/globalmods/apoc/readme.txt
623
games/scorched3d/data/globalmods/apoc/readme.txt
625
games/scorched3d/data/globalmods/globalmods.txt
624
games/scorched3d/data/globalmods/globalmods.txt
625
games/scorched3d/data/html/server/account.html
626
games/scorched3d/data/html/server/adminmenu.html
626
games/scorched3d/data/html/server/applet.html
627
games/scorched3d/data/html/server/applet.html
627
games/scorched3d/data/html/server/banned.html
628
games/scorched3d/data/html/server/banned.html
628
games/scorched3d/data/html/server/binary/Applet.jar
629
games/scorched3d/data/html/server/binary/Applet.jar
Lines 660-679 Link Here
660
games/scorched3d/data/landscapes/ambientsoundwaves.xml
661
games/scorched3d/data/landscapes/ambientsoundwaves.xml
661
games/scorched3d/data/landscapes/ascencion-pic.bmp
662
games/scorched3d/data/landscapes/ascencion-pic.bmp
662
games/scorched3d/data/landscapes/ascencion.bmp
663
games/scorched3d/data/landscapes/ascencion.bmp
664
games/scorched3d/data/landscapes/ascencion2.bmp
663
games/scorched3d/data/landscapes/boidsah64.xml
665
games/scorched3d/data/landscapes/boidsah64.xml
664
games/scorched3d/data/landscapes/boidsbats.xml
666
games/scorched3d/data/landscapes/boidsbats.xml
665
games/scorched3d/data/landscapes/boidsf16.xml
667
games/scorched3d/data/landscapes/boidsf16.xml
666
games/scorched3d/data/landscapes/boidsf18.xml
668
games/scorched3d/data/landscapes/boidsf18.xml
667
games/scorched3d/data/landscapes/boidsgulls.xml
669
games/scorched3d/data/landscapes/boidsgulls.xml
670
games/scorched3d/data/landscapes/boidslargenumber.xml
668
games/scorched3d/data/landscapes/boidsparrot.xml
671
games/scorched3d/data/landscapes/boidsparrot.xml
669
games/scorched3d/data/landscapes/canyon-pic.bmp
672
games/scorched3d/data/landscapes/canyon-pic.bmp
670
games/scorched3d/data/landscapes/canyon.bmp
673
games/scorched3d/data/landscapes/canyon.bmp
671
games/scorched3d/data/landscapes/cavern-pic.bmp
674
games/scorched3d/data/landscapes/cavern-pic.bmp
675
games/scorched3d/data/landscapes/circle.bmp
672
games/scorched3d/data/landscapes/defnascencion.xml
676
games/scorched3d/data/landscapes/defnascencion.xml
677
games/scorched3d/data/landscapes/defnascencion2.xml
673
games/scorched3d/data/landscapes/defncanyon.xml
678
games/scorched3d/data/landscapes/defncanyon.xml
679
games/scorched3d/data/landscapes/defncanyon2.xml
674
games/scorched3d/data/landscapes/defncavern.xml
680
games/scorched3d/data/landscapes/defncavern.xml
681
games/scorched3d/data/landscapes/defncavern2.xml
675
games/scorched3d/data/landscapes/defndenali.xml
682
games/scorched3d/data/landscapes/defndenali.xml
683
games/scorched3d/data/landscapes/defndenali2.xml
684
games/scorched3d/data/landscapes/defndenali3.xml
676
games/scorched3d/data/landscapes/defnglaciation.xml
685
games/scorched3d/data/landscapes/defnglaciation.xml
686
games/scorched3d/data/landscapes/defnglaciation2.xml
687
games/scorched3d/data/landscapes/defnglaciation3.xml
677
games/scorched3d/data/landscapes/defnhalfed.xml
688
games/scorched3d/data/landscapes/defnhalfed.xml
678
games/scorched3d/data/landscapes/defnhilly.xml
689
games/scorched3d/data/landscapes/defnhilly.xml
679
games/scorched3d/data/landscapes/defnicebergs2.xml
690
games/scorched3d/data/landscapes/defnicebergs2.xml
Lines 681-697 Link Here
681
games/scorched3d/data/landscapes/defnislands.xml
692
games/scorched3d/data/landscapes/defnislands.xml
682
games/scorched3d/data/landscapes/defnlowlands.xml
693
games/scorched3d/data/landscapes/defnlowlands.xml
683
games/scorched3d/data/landscapes/defnoldstyle.xml
694
games/scorched3d/data/landscapes/defnoldstyle.xml
695
games/scorched3d/data/landscapes/defnoldstyleerrosion.xml
684
games/scorched3d/data/landscapes/defnridge.xml
696
games/scorched3d/data/landscapes/defnridge.xml
685
games/scorched3d/data/landscapes/defnspike.xml
697
games/scorched3d/data/landscapes/defnspike.xml
686
games/scorched3d/data/landscapes/defntest.xml
698
games/scorched3d/data/landscapes/defntest.xml
687
games/scorched3d/data/landscapes/defnvalley.xml
699
games/scorched3d/data/landscapes/defnvalley.xml
688
games/scorched3d/data/landscapes/denali-pic.bmp
700
games/scorched3d/data/landscapes/denali-pic.bmp
689
games/scorched3d/data/landscapes/denali.bmp
701
games/scorched3d/data/landscapes/denali.bmp
702
games/scorched3d/data/landscapes/denali2.bmp
703
games/scorched3d/data/landscapes/denali3.bmp
690
games/scorched3d/data/landscapes/eventslightning.xml
704
games/scorched3d/data/landscapes/eventslightning.xml
691
games/scorched3d/data/landscapes/eventsmeteor.xml
705
games/scorched3d/data/landscapes/eventsmeteor.xml
692
games/scorched3d/data/landscapes/eventstest.xml
706
games/scorched3d/data/landscapes/eventstest.xml
707
games/scorched3d/data/landscapes/fjords.bmp
693
games/scorched3d/data/landscapes/glaciation-pic.bmp
708
games/scorched3d/data/landscapes/glaciation-pic.bmp
694
games/scorched3d/data/landscapes/glaciation.bmp
709
games/scorched3d/data/landscapes/glaciation.bmp
710
games/scorched3d/data/landscapes/glaciation2.bmp
711
games/scorched3d/data/landscapes/glaciation3.bmp
695
games/scorched3d/data/landscapes/half-mask-start.bmp
712
games/scorched3d/data/landscapes/half-mask-start.bmp
696
games/scorched3d/data/landscapes/half-mask.bmp
713
games/scorched3d/data/landscapes/half-mask.bmp
697
games/scorched3d/data/landscapes/halfed-pic.bmp
714
games/scorched3d/data/landscapes/halfed-pic.bmp
Lines 720-725 Link Here
720
games/scorched3d/data/landscapes/placepalm2.xml
737
games/scorched3d/data/landscapes/placepalm2.xml
721
games/scorched3d/data/landscapes/placepine.xml
738
games/scorched3d/data/landscapes/placepine.xml
722
games/scorched3d/data/landscapes/placepine2.xml
739
games/scorched3d/data/landscapes/placepine2.xml
740
games/scorched3d/data/landscapes/placepinelargenumber.xml
723
games/scorched3d/data/landscapes/placepingu.xml
741
games/scorched3d/data/landscapes/placepingu.xml
724
games/scorched3d/data/landscapes/placesnowpine.xml
742
games/scorched3d/data/landscapes/placesnowpine.xml
725
games/scorched3d/data/landscapes/placetest.xml
743
games/scorched3d/data/landscapes/placetest.xml
Lines 744-749 Link Here
744
games/scorched3d/data/landscapes/texchina.xml
762
games/scorched3d/data/landscapes/texchina.xml
745
games/scorched3d/data/landscapes/texdefault.xml
763
games/scorched3d/data/landscapes/texdefault.xml
746
games/scorched3d/data/landscapes/texdenali.xml
764
games/scorched3d/data/landscapes/texdenali.xml
765
games/scorched3d/data/landscapes/texdenalilandperf.xml
747
games/scorched3d/data/landscapes/texhell.xml
766
games/scorched3d/data/landscapes/texhell.xml
748
games/scorched3d/data/landscapes/texice.xml
767
games/scorched3d/data/landscapes/texice.xml
749
games/scorched3d/data/landscapes/texnight.xml
768
games/scorched3d/data/landscapes/texnight.xml
Lines 757-762 Link Here
757
games/scorched3d/data/landscapes/texvulcano.xml
776
games/scorched3d/data/landscapes/texvulcano.xml
758
games/scorched3d/data/landscapes/valley-mask.bmp
777
games/scorched3d/data/landscapes/valley-mask.bmp
759
games/scorched3d/data/landscapes/valley-pic.bmp
778
games/scorched3d/data/landscapes/valley-pic.bmp
779
games/scorched3d/data/lang/lang.resource
780
games/scorched3d/data/lua/accessories/test.lua
760
games/scorched3d/data/mediumdisplay.xml
781
games/scorched3d/data/mediumdisplay.xml
761
games/scorched3d/data/meshes/ah64d/ah64.bmp
782
games/scorched3d/data/meshes/ah64d/ah64.bmp
762
games/scorched3d/data/meshes/ah64d/ah64d.txt
783
games/scorched3d/data/meshes/ah64d/ah64d.txt
Lines 809-819 Link Here
809
games/scorched3d/data/random.no
830
games/scorched3d/data/random.no
810
games/scorched3d/data/safedisplay.xml
831
games/scorched3d/data/safedisplay.xml
811
games/scorched3d/data/server.xml
832
games/scorched3d/data/server.xml
833
games/scorched3d/data/shaders/land-splat.fshader
812
games/scorched3d/data/shaders/land.fshader
834
games/scorched3d/data/shaders/land.fshader
813
games/scorched3d/data/shaders/land.vshader
835
games/scorched3d/data/shaders/land.vshader
814
games/scorched3d/data/shaders/water.fshader
836
games/scorched3d/data/shaders/water.fshader
815
games/scorched3d/data/shaders/water.license
837
games/scorched3d/data/shaders/water.license
816
games/scorched3d/data/shaders/water.vshader
838
games/scorched3d/data/shaders/water.vshader
839
games/scorched3d/data/shaders/watersimple.fshader
840
games/scorched3d/data/shaders/watersimple.vshader
817
games/scorched3d/data/singlecustom.xml
841
games/scorched3d/data/singlecustom.xml
818
games/scorched3d/data/singleeasy.xml
842
games/scorched3d/data/singleeasy.xml
819
games/scorched3d/data/singlehard.xml
843
games/scorched3d/data/singlehard.xml
Lines 832-839 Link Here
832
games/scorched3d/data/tankais.xml
856
games/scorched3d/data/tankais.xml
833
games/scorched3d/data/tankaiweaponsets.xml
857
games/scorched3d/data/tankaiweaponsets.xml
834
games/scorched3d/data/tanks.xml
858
games/scorched3d/data/tanks.xml
835
games/scorched3d/data/tanks/CF-104/104.bmp
836
games/scorched3d/data/tanks/CF-104/104.txt
837
games/scorched3d/data/tanks/a7v.ase
859
games/scorched3d/data/tanks/a7v.ase
838
games/scorched3d/data/tanks/a7v.bmp
860
games/scorched3d/data/tanks/a7v.bmp
839
games/scorched3d/data/tanks/aat.ase
861
games/scorched3d/data/tanks/aat.ase
Lines 871-876 Link Here
871
games/scorched3d/data/tanks/cannont/side.bmp
893
games/scorched3d/data/tanks/cannont/side.bmp
872
games/scorched3d/data/tanks/cannont/side2.bmp
894
games/scorched3d/data/tanks/cannont/side2.bmp
873
games/scorched3d/data/tanks/cannont/top.bmp
895
games/scorched3d/data/tanks/cannont/top.bmp
896
games/scorched3d/data/tanks/cf-104/104.bmp
897
games/scorched3d/data/tanks/cf-104/104.txt
874
games/scorched3d/data/tanks/death/black.bmp
898
games/scorched3d/data/tanks/death/black.bmp
875
games/scorched3d/data/tanks/death/chrome.bmp
899
games/scorched3d/data/tanks/death/chrome.bmp
876
games/scorched3d/data/tanks/death/death.txt
900
games/scorched3d/data/tanks/death/death.txt
Lines 1066-1071 Link Here
1066
games/scorched3d/data/textures/bordershield/grid2.bmp
1090
games/scorched3d/data/textures/bordershield/grid2.bmp
1067
games/scorched3d/data/textures/bordershield/grid22.bmp
1091
games/scorched3d/data/textures/bordershield/grid22.bmp
1068
games/scorched3d/data/textures/bordershield/hit.bmp
1092
games/scorched3d/data/textures/bordershield/hit.bmp
1093
games/scorched3d/data/textures/circle.bmp
1094
games/scorched3d/data/textures/circlem.bmp
1095
games/scorched3d/data/textures/circlew.bmp
1069
games/scorched3d/data/textures/clearsky.bmp
1096
games/scorched3d/data/textures/clearsky.bmp
1070
games/scorched3d/data/textures/explode/explosion0/exp0004.bmp
1097
games/scorched3d/data/textures/explode/explosion0/exp0004.bmp
1071
games/scorched3d/data/textures/explode/explosion0/exp0008.bmp
1098
games/scorched3d/data/textures/explode/explosion0/exp0008.bmp
Lines 1248-1254 Link Here
1248
games/scorched3d/data/textures/landscape/china/texture0.bmp
1275
games/scorched3d/data/textures/landscape/china/texture0.bmp
1249
games/scorched3d/data/textures/landscape/china/texture1.bmp
1276
games/scorched3d/data/textures/landscape/china/texture1.bmp
1250
games/scorched3d/data/textures/landscape/china/texture2.bmp
1277
games/scorched3d/data/textures/landscape/china/texture2.bmp
1251
games/scorched3d/data/textures/landscape/china/texture2.jpg
1252
games/scorched3d/data/textures/landscape/china/texture3.bmp
1278
games/scorched3d/data/textures/landscape/china/texture3.bmp
1253
games/scorched3d/data/textures/landscape/china/texture4.bmp
1279
games/scorched3d/data/textures/landscape/china/texture4.bmp
1254
games/scorched3d/data/textures/landscape/china/water.bmp
1280
games/scorched3d/data/textures/landscape/china/water.bmp
Lines 1590-1595 Link Here
1590
games/scorched3d/data/windows/move.bmp
1616
games/scorched3d/data/windows/move.bmp
1591
games/scorched3d/data/windows/noentry.bmp
1617
games/scorched3d/data/windows/noentry.bmp
1592
games/scorched3d/data/windows/ok.bmp
1618
games/scorched3d/data/windows/ok.bmp
1619
games/scorched3d/data/windows/perf.bmp
1620
games/scorched3d/data/windows/perfa.bmp
1593
games/scorched3d/data/windows/plan.bmp
1621
games/scorched3d/data/windows/plan.bmp
1594
games/scorched3d/data/windows/plana.bmp
1622
games/scorched3d/data/windows/plana.bmp
1595
games/scorched3d/data/windows/planaa.bmp
1623
games/scorched3d/data/windows/planaa.bmp
Lines 1709-1721 Link Here
1709
@dirrm games/scorched3d/data/tanks/guntower
1737
@dirrm games/scorched3d/data/tanks/guntower
1710
@dirrm games/scorched3d/data/tanks/gorilla
1738
@dirrm games/scorched3d/data/tanks/gorilla
1711
@dirrm games/scorched3d/data/tanks/death
1739
@dirrm games/scorched3d/data/tanks/death
1740
@dirrm games/scorched3d/data/tanks/cf-104
1712
@dirrm games/scorched3d/data/tanks/cannont
1741
@dirrm games/scorched3d/data/tanks/cannont
1713
@dirrm games/scorched3d/data/tanks/cannon
1742
@dirrm games/scorched3d/data/tanks/cannon
1714
@dirrm games/scorched3d/data/tanks/bradley2
1743
@dirrm games/scorched3d/data/tanks/bradley2
1715
@dirrm games/scorched3d/data/tanks/bm13
1744
@dirrm games/scorched3d/data/tanks/bm13
1716
@dirrm games/scorched3d/data/tanks/bender
1745
@dirrm games/scorched3d/data/tanks/bender
1717
@dirrm games/scorched3d/data/tanks/battleship
1746
@dirrm games/scorched3d/data/tanks/battleship
1718
@dirrm games/scorched3d/data/tanks/CF-104
1719
@dirrm games/scorched3d/data/tanks
1747
@dirrm games/scorched3d/data/tanks
1720
@dirrm games/scorched3d/data/talk/polish
1748
@dirrm games/scorched3d/data/talk/polish
1721
@dirrm games/scorched3d/data/talk/german
1749
@dirrm games/scorched3d/data/talk/german
Lines 1737-1742 Link Here
1737
@dirrm games/scorched3d/data/meshes/arara
1765
@dirrm games/scorched3d/data/meshes/arara
1738
@dirrm games/scorched3d/data/meshes/ah64d
1766
@dirrm games/scorched3d/data/meshes/ah64d
1739
@dirrm games/scorched3d/data/meshes
1767
@dirrm games/scorched3d/data/meshes
1768
@dirrm games/scorched3d/data/lua/accessories
1769
@dirrm games/scorched3d/data/lua
1770
@dirrm games/scorched3d/data/lang
1740
@dirrm games/scorched3d/data/landscapes
1771
@dirrm games/scorched3d/data/landscapes
1741
@dirrm games/scorched3d/data/html/server/binary
1772
@dirrm games/scorched3d/data/html/server/binary
1742
@dirrm games/scorched3d/data/html/server
1773
@dirrm games/scorched3d/data/html/server
(-)files/patch-src-client-client-SecureID.cpp (+51 lines)
Line 0 Link Here
1
--- src/client/client/SecureID.cpp.orig	2008-03-03 00:47:36.000000000 +0600
2
+++ src/client/client/SecureID.cpp	2009-09-26 20:05:52.000000000 +0700
3
@@ -33,6 +33,48 @@
4
 {
5
 	return "0:0:0:0:0:0";
6
 }
7
+#elif defined(__FreeBSD__)
8
+
9
+#include <sys/types.h>
10
+#include <sys/socket.h>
11
+#include <net/if_dl.h>
12
+#include <ifaddrs.h>
13
+
14
+std::string SecureID::GetPrivateKey(void)
15
+{
16
+       std::string Key;
17
+       struct ifaddrs* ifaphead;
18
+
19
+       if (getifaddrs(&ifaphead) != 0)
20
+       {
21
+               return "";
22
+       }
23
+
24
+       for (struct ifaddrs* ifap = ifaphead; ifap; ifap = ifap->ifa_next)
25
+       {
26
+               if (ifap->ifa_addr->sa_family == AF_LINK)
27
+               {
28
+                       if (strncmp(ifap->ifa_name, "lo", 2) != 0)
29
+                       {
30
+                               struct sockaddr_dl* sdl =
31
+                                       (struct sockaddr_dl *)ifap->ifa_addr;
32
+                               unsigned char* if_mac = (unsigned char*)LLADDR(sdl);
33
+                               char buf[18];
34
+                               snprintf(buf, 18,
35
+                                       "%02x:%02x:%02x:%02x:%02x:%02x",
36
+                                       if_mac[0], if_mac[1], if_mac[2],
37
+                                       if_mac[3], if_mac[4], if_mac[5]);
38
+                               Key = buf;
39
+                               break;
40
+                       }
41
+               }
42
+       }
43
+
44
+       freeifaddrs(ifaphead);
45
+       return Key;
46
+}
47
+
48
+
49
 
50
 #else
51
 
(-)files/patch-src-net-SecureID.cpp (-50 lines)
Lines 1-50 Link Here
1
--- src/net/SecureID.cpp.orig	2008-03-31 00:52:26.000000000 -0600
2
+++ src/net/SecureID.cpp	2008-03-31 22:04:44.000000000 -0600
3
@@ -34,6 +34,47 @@
4
 	return "0:0:0:0:0:0";
5
 }
6
 
7
+#elif defined(__FreeBSD__)
8
+
9
+#include <sys/types.h>
10
+#include <sys/socket.h>
11
+#include <net/if_dl.h>
12
+#include <ifaddrs.h>
13
+
14
+std::string SecureID::GetPrivateKey(void)
15
+{
16
+	std::string Key;
17
+	struct ifaddrs* ifaphead;
18
+
19
+	if (getifaddrs(&ifaphead) != 0)
20
+	{
21
+		return "";
22
+	}
23
+
24
+	for (struct ifaddrs* ifap = ifaphead; ifap; ifap = ifap->ifa_next)
25
+	{
26
+		if (ifap->ifa_addr->sa_family == AF_LINK)
27
+		{
28
+			if (strncmp(ifap->ifa_name, "lo", 2) != 0)
29
+			{
30
+				struct sockaddr_dl* sdl =
31
+					(struct sockaddr_dl *)ifap->ifa_addr;
32
+				unsigned char* if_mac = (unsigned char*)LLADDR(sdl);
33
+				char buf[18];
34
+				snprintf(buf, 18,
35
+					"%02x:%02x:%02x:%02x:%02x:%02x",
36
+					if_mac[0], if_mac[1], if_mac[2],
37
+					if_mac[3], if_mac[4], if_mac[5]);
38
+				Key = buf;
39
+				break;	
40
+			}
41
+		}
42
+	}
43
+
44
+	freeifaddrs(ifaphead);
45
+	return Key;
46
+}
47
+
48
 #else
49
 
50
 #include <sys/ioctl.h>

Return to bug 139201