Adding olsrd

This commit is contained in:
Pierre Pronchery 2009-06-29 15:41:01 +00:00 committed by Thomas Klausner
parent af50e521bf
commit bb86fa6895
7 changed files with 136 additions and 0 deletions

0
olsrd/DESCR Normal file
View file

15
olsrd/Makefile Normal file
View file

@ -0,0 +1,15 @@
# $NetBSD: Makefile,v 1.1 2009/06/29 15:41:01 khorben Exp $
#
DISTNAME= olsrd-0.5.6-r5
CATEGORIES= wip
MASTER_SITES= http://www.olsr.org/releases/0.5/
MAINTAINER= khorben@defora.org
HOMEPAGE= http://www.olsr.org/
COMMENT= Ad-hoc wireless mesh routing daemon
LICENSE= modified-bsd
USE_TOOLS+= gmake
.include "../../mk/bsd.pkg.mk"

1
olsrd/PLIST Normal file
View file

@ -0,0 +1 @@
@comment $NetBSD: PLIST,v 1.1 2009/06/29 15:41:01 khorben Exp $

8
olsrd/distinfo Normal file
View file

@ -0,0 +1,8 @@
$NetBSD: distinfo,v 1.1 2009/06/29 15:41:01 khorben Exp $
SHA1 (olsrd-0.5.6-r5.tar.gz) = ffdb773c840e03e269ca67fd39fd0fec623fa61a
RMD160 (olsrd-0.5.6-r5.tar.gz) = 67d7957659b75d8a22c483d245f5026104f582db
Size (olsrd-0.5.6-r5.tar.gz) = 655329 bytes
SHA1 (patch-aa) = c9cd8a8953055085d838ec355793e0e48528a22e
SHA1 (patch-ab) = 71495098a11442f3c5f27c1439f378c326a1021b
SHA1 (patch-ac) = ebd8cebc8b524b4ac47d83f7fd80457170d65c75

68
olsrd/patches/patch-aa Normal file
View file

@ -0,0 +1,68 @@
$NetBSD: patch-aa,v 1.1 2009/06/29 15:41:01 khorben Exp $
--- src/bsd/net.c.orig 2009-06-24 19:00:51.000000000 +0200
+++ src/bsd/net.c
@@ -1,4 +1,3 @@
-
/*
* The olsr.org Optimized Link-State Routing daemon(olsrd)
* Copyright (c) 2004, Andreas Tonnesen(andreto@olsr.org)
@@ -73,6 +72,9 @@
#ifdef __NetBSD__
#include <net/if_ether.h>
+#include <netinet6/in6_var.h> /* For struct in6_ifreq */
+#include <net80211/ieee80211_ioctl.h>
+#include <ifaddrs.h>
#endif
#ifdef __OpenBSD__
@@ -127,7 +129,7 @@ static int
set_sysctl_int(const char *name, int new)
{
int old;
-#if __MacOSX__ || __OpenBSD__
+#if defined(__MacOSX__) || defined(__OpenBSD__) || defined(__NetBSD__)
size_t len = sizeof(old);
#else
unsigned int len = sizeof(old);
@@ -191,7 +193,7 @@ disable_redirects_global(int version)
/* do not accept ICMP redirects */
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__NetBSD__)
if (version == AF_INET)
name = "net.inet.icmp.rediraccept";
else
@@ -731,9 +733,11 @@ olsr_recvfrom(int s, void *buf, size_t l
inet_ntop(olsr_cnf->ip_version, olsr_cnf->ip_version == AF_INET6 ? (char *)&sin6->sin6_addr : (char *)&sin->sin_addr,
addrstr, sizeof(addrstr)), ifc->int_name, iname);
+#ifndef __NetBSD__
if (strcmp(ifc->int_name, iname) != 0) {
return (0);
}
+#endif
return (count);
}
@@ -768,6 +772,18 @@ check_wireless_interface(char *ifname)
bzero(&nr, sizeof(nr));
strlcpy(nr.nr_ifname, ifname, sizeof(nr.nr_ifname));
return (ioctl(olsr_cnf->ioctl_s, SIOCG80211FLAGS, &nr) >= 0) ? 1 : 0;
+#elif defined __NetBSD__
+ struct ifreq ireq;
+ struct ieee80211_nwid data;
+ int ret;
+
+ memset(&ireq, 0, sizeof(ireq));
+ strlcpy(ireq.ifr_name, ifname, sizeof(ireq.ifr_name));
+ ireq.ifr_data = &data;
+ ret = ioctl(olsr_cnf->ioctl_s, SIOCG80211NWID, &ireq);
+ if(ret == 0)
+ return 1;
+ return 0;
#else
ifname = NULL; /* squelsh compiler warning */
return 0;

21
olsrd/patches/patch-ab Normal file
View file

@ -0,0 +1,21 @@
$NetBSD: patch-ab,v 1.1 2009/06/29 15:41:01 khorben Exp $
--- Makefile.inc.orig 2009-06-24 19:00:51.000000000 +0200
+++ Makefile.inc
@@ -41,11 +41,12 @@ TAGCMD ?= etags
# target directories and names
DESTDIR ?=
-SBINDIR ?= $(DESTDIR)/usr/sbin
+DESTDIR ?= /usr
+SBINDIR ?= $(DESTDIR)$(PREFIX)/sbin
ETCDIR ?= $(DESTDIR)/etc
-LIBDIR ?= $(DESTDIR)/usr/lib
-DOCDIR ?= $(DESTDIR)/usr/share/doc
-MANDIR ?= $(DESTDIR)/usr/share/man
+LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
+DOCDIR ?= $(DESTDIR)$(PREFIX)/share/doc
+MANDIR ?= $(DESTDIR)$(PREFIX)/share/man
EXENAME ?= olsrd
CFGNAME ?= $(EXENAME).conf
CFGFILE ?= $(ETCDIR)/$(CFGNAME)

23
olsrd/patches/patch-ac Normal file
View file

@ -0,0 +1,23 @@
$NetBSD: patch-ac,v 1.1 2009/06/29 15:41:01 khorben Exp $
--- Makefile.orig 2009-06-24 19:46:45.000000000 +0200
+++ Makefile
@@ -118,15 +118,15 @@ install_olsrd: install_bin
@echo can be found at files/olsrd.conf.default.lq
@echo ==========================================================
mkdir -p $(ETCDIR)
- -cp -i files/olsrd.conf.default.lq $(CFGFILE)
+ -install -m 644 files/olsrd.conf.default.lq $(CFGFILE)
@echo -------------------------------------------
@echo Edit $(CFGFILE) before running olsrd!!
@echo -------------------------------------------
@echo Installing manpages $(EXENAME)\(8\) and $(CFGNAME)\(5\)
mkdir -p $(MANDIR)/man8/
- cp files/olsrd.8.gz $(MANDIR)/man8/$(EXENAME).8.gz
+ install -m 644 files/olsrd.8.gz $(MANDIR)/man8/$(EXENAME).8.gz
mkdir -p $(MANDIR)/man5/
- cp files/olsrd.conf.5.gz $(MANDIR)/man5/$(CFGNAME).5.gz
+ install -m 644 files/olsrd.conf.5.gz $(MANDIR)/man5/$(CFGNAME).5.gz
tags:
$(TAGCMD) -o $(TAGFILE) $(TAG_SRCS)