[GH-ISSUE #18] freebsd support? #10

Closed
opened 2026-02-25 22:30:45 +03:00 by kerem · 8 comments
Owner

Originally created by @bbrendon on GitHub (Aug 1, 2017).
Original GitHub issue: https://github.com/evgeny-gridasov/openvpn-otp/issues/18

Will this work on freebsd?

Originally created by @bbrendon on GitHub (Aug 1, 2017). Original GitHub issue: https://github.com/evgeny-gridasov/openvpn-otp/issues/18 Will this work on freebsd?
kerem closed this issue 2026-02-25 22:30:45 +03:00
Author
Owner

@bbrendon commented on GitHub (Aug 2, 2017):

I got as far as
configure: error: OpenVPN headers missing

<!-- gh-comment-id:319533618 --> @bbrendon commented on GitHub (Aug 2, 2017): I got as far as `configure: error: OpenVPN headers missing`
Author
Owner

@evgeny-gridasov commented on GitHub (Aug 2, 2017):

Hi Brendon, do you have openvpn headers installed?
If so, what's the headers location?

<!-- gh-comment-id:319538894 --> @evgeny-gridasov commented on GitHub (Aug 2, 2017): Hi Brendon, do you have openvpn headers installed? If so, what's the headers location?
Author
Owner

@bbrendon commented on GitHub (Sep 5, 2017):

I got past the headers issue. I found another issue with something about it. Fix is:

pkg install openvpn-devel-201725
mkdir /usr/include/openvpn
cp /usr/local/include/openvpn-plugin.h /usr/include/openvpn

The new issue ...
I looked at some of the endian.h files but they are all different. I'm not sure which one I should even attempt to make work. Any ideas?

root@freebsd10:~/a/openvpn-otp # make
make  all-recursive
Making all in src
/bin/sh ../libtool  --tag=CC    --mode=compile cc -DHAVE_CONFIG_H  -I. -I..      -g -O2 -MT otp.lo -MD -MP -MF .deps/otp.Tpo -c -o otp.lo otp.c
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT otp.lo -MD -MP -MF .deps/otp.Tpo -c otp.c  -fPIC -DPIC -o .libs/otp.o
otp.c:5:10: fatal error: 'endian.h' file not found
#include <endian.h>
         ^
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /root/a/openvpn-otp/src
*** Error code 1

Stop.
make[1]: stopped in /root/a/openvpn-otp
*** Error code 1

Stop.
make: stopped in /root/a/openvpn-otp
root@freebsd10:~/a/openvpn-otp # locate endian.h
/usr/include/dev/usb/usb_endian.h
/usr/include/machine/endian.h
/usr/include/netatalk/endian.h
/usr/include/sys/endian.h
/usr/include/x86/endian.h
root@freebsd10:~/a/openvpn-otp #

I also noticed someone else working on pfsense/freebsd. https://github.com/evgeny-gridasov/openvpn-otp/issues/12

<!-- gh-comment-id:327284792 --> @bbrendon commented on GitHub (Sep 5, 2017): I got past the headers issue. I found another issue with something about it. Fix is: ``` pkg install openvpn-devel-201725 mkdir /usr/include/openvpn cp /usr/local/include/openvpn-plugin.h /usr/include/openvpn ``` The new issue ... I looked at some of the endian.h files but they are all different. I'm not sure which one I should even attempt to make work. Any ideas? ``` root@freebsd10:~/a/openvpn-otp # make make all-recursive Making all in src /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT otp.lo -MD -MP -MF .deps/otp.Tpo -c -o otp.lo otp.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT otp.lo -MD -MP -MF .deps/otp.Tpo -c otp.c -fPIC -DPIC -o .libs/otp.o otp.c:5:10: fatal error: 'endian.h' file not found #include <endian.h> ^ 1 error generated. *** Error code 1 Stop. make[2]: stopped in /root/a/openvpn-otp/src *** Error code 1 Stop. make[1]: stopped in /root/a/openvpn-otp *** Error code 1 Stop. make: stopped in /root/a/openvpn-otp root@freebsd10:~/a/openvpn-otp # locate endian.h /usr/include/dev/usb/usb_endian.h /usr/include/machine/endian.h /usr/include/netatalk/endian.h /usr/include/sys/endian.h /usr/include/x86/endian.h root@freebsd10:~/a/openvpn-otp # ``` I also noticed someone else working on pfsense/freebsd. https://github.com/evgeny-gridasov/openvpn-otp/issues/12
Author
Owner

@haarp commented on GitHub (Sep 6, 2017):

Here's how I got it to work, this was back on pfSense 2.1 or 2.2 I think.

  • Install FreeBSD compatible with pfSense version
  • Install ports
  • Install openvpn-devel via ports
    WITHOUT_CHECK=yes make install
  • Install autotools
  • Download & Extract & cd into openvpn-otp
  • Compile
./autogen.sh
./configure --prefix=/usr/local CPPFLAGS="-I/usr/include/machine/ -I/usr/local/include/"
make
  • Copy src/.libs/openvpn-otp.so to pfSense, e.g. /usr/local/lib/openvpn-otp.so
<!-- gh-comment-id:327415413 --> @haarp commented on GitHub (Sep 6, 2017): Here's how I got it to work, this was back on pfSense 2.1 or 2.2 I think. - Install FreeBSD compatible with pfSense version - Install ports - Install openvpn-devel via ports `WITHOUT_CHECK=yes make install` - Install autotools - Download & Extract & cd into openvpn-otp - Compile ``` ./autogen.sh ./configure --prefix=/usr/local CPPFLAGS="-I/usr/include/machine/ -I/usr/local/include/" make ``` - Copy src/.libs/openvpn-otp.so to pfSense, e.g. /usr/local/lib/openvpn-otp.so
Author
Owner

@evgeny-gridasov commented on GitHub (Sep 7, 2017):

Guys, I don't have time to test it on FreeBSD. If anyone has it 100% working, I'd be more than happy to accept a pull request that will add a FreeBSD HOWTO section to readme.md

<!-- gh-comment-id:327655142 --> @evgeny-gridasov commented on GitHub (Sep 7, 2017): Guys, I don't have time to test it on FreeBSD. If anyone has it 100% working, I'd be more than happy to accept a pull request that will add a FreeBSD HOWTO section to readme.md
Author
Owner

@RNCTX commented on GitHub (Jun 20, 2018):

Stumbled on this via google. Got warnings during compile using suggestions in this reply about machine/ being deprecated in favor of sys/ (on FreeBSD 11.1-RELEASE). There is a hard-coded search path for /usr/include somewhere, because prefixing /usr/local as FreeBSD uses does not find the openvpn headers. Unfortunately the FreeBSD openvpn package does not include any pkgconfig files, so pkgconfig wouldn't help.

So my modified configure was...

./configure --with-openvpn-plugin-dir=/usr/local/lib/openvpn/plugins --prefix=/usr/local CPPFLAGS="-I/usr/include/sys -I/usr/local/include/"

after making a symlink to the header where the autoconf tools in this distribution want it...

ln -s /usr/local/include/openvpn-plugin.h /usr/include/openvpn-plugin.h

This is assuming that openvpn was installed from ports or the official FreeBSD pkg. The plugin directory above is the FreeBSD port/pkg default.

I built it successfully, but haven't tested yet. Here are the warnings...

otp.c:125:35: warning: implicitly declaring library function 'isspace' with type 'int (int)' [-Wimplicit-function-declaration]
    while (!feof(secrets_file) && isspace((ch = fgetc(secrets_file)))) {
                                  ^
otp.c:125:35: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'
otp.c:277:17: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign
      [-Wpointer-sign]
        sprintf(&hexdigest[i*2], "%02x", hash[i]);
                ^~~~~~~~~~~~~~~
/usr/include/stdio.h:277:31: note: passing argument to parameter here
int      sprintf(char * __restrict, const char * __restrict, ...);
                                  ^
otp.c:310:17: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign
      [-Wpointer-sign]
        sprintf(&hexdigest[i*2], "%02x", hash[i]);
                ^~~~~~~~~~~~~~~
/usr/include/stdio.h:277:31: note: passing argument to parameter here
int      sprintf(char * __restrict, const char * __restrict, ...);
                                  ^
otp.c:420:18: warning: implicit declaration of function 'time' is invalid in C99 [-Wimplicit-function-declaration]
            T = (time(NULL) - totp_t0) / tstep;
                 ^
4 warnings generated.

Will post back after testing.

<!-- gh-comment-id:398921554 --> @RNCTX commented on GitHub (Jun 20, 2018): Stumbled on this via google. Got warnings during compile using suggestions in [this reply](https://github.com/evgeny-gridasov/openvpn-otp/issues/18#issuecomment-327415413) about machine/ being deprecated in favor of sys/ (on FreeBSD 11.1-RELEASE). There is a hard-coded search path for /usr/include somewhere, because prefixing /usr/local as FreeBSD uses does not find the openvpn headers. Unfortunately the FreeBSD openvpn package does not include any pkgconfig files, so pkgconfig wouldn't help. So my modified configure was... `./configure --with-openvpn-plugin-dir=/usr/local/lib/openvpn/plugins --prefix=/usr/local CPPFLAGS="-I/usr/include/sys -I/usr/local/include/"` after making a symlink to the header where the autoconf tools in this distribution want it... `ln -s /usr/local/include/openvpn-plugin.h /usr/include/openvpn-plugin.h` This is assuming that openvpn was installed from ports or the official FreeBSD pkg. The plugin directory above is the FreeBSD port/pkg default. I built it successfully, but haven't tested yet. Here are the warnings... ``` otp.c:125:35: warning: implicitly declaring library function 'isspace' with type 'int (int)' [-Wimplicit-function-declaration] while (!feof(secrets_file) && isspace((ch = fgetc(secrets_file)))) { ^ otp.c:125:35: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace' otp.c:277:17: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign] sprintf(&hexdigest[i*2], "%02x", hash[i]); ^~~~~~~~~~~~~~~ /usr/include/stdio.h:277:31: note: passing argument to parameter here int sprintf(char * __restrict, const char * __restrict, ...); ^ otp.c:310:17: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign] sprintf(&hexdigest[i*2], "%02x", hash[i]); ^~~~~~~~~~~~~~~ /usr/include/stdio.h:277:31: note: passing argument to parameter here int sprintf(char * __restrict, const char * __restrict, ...); ^ otp.c:420:18: warning: implicit declaration of function 'time' is invalid in C99 [-Wimplicit-function-declaration] T = (time(NULL) - totp_t0) / tstep; ^ 4 warnings generated. ``` Will post back after testing.
Author
Owner

@evgeny-gridasov commented on GitHub (Jun 21, 2018):

Hey Robert,

I've done zero testing on FreeBSD, and while I still like the OS, I have no
free time to test that. I am sure somebody else had some success in it.
You're welcome to provide a fix via a pull request.

Regards,
Evgeny.

On Thursday, June 21, 2018, Robert Clayton notifications@github.com wrote:

Stumbled on this via google. Warnings during compile using suggestions in this
reply
https://github.com/evgeny-gridasov/openvpn-otp/issues/18#issuecomment-327415413
about machine/ being deprecated in favor of sys/ (on FreeBSD 11.1-RELEASE).
There is a hard-coded search path for /usr/include somewhere, because
prefixing /usr/local as FreeBSD uses does not find the openvpn headers.

So my modified configure was...

./configure --with-openvpn-plugin-dir=/usr/local/lib/openvpn/plugins
--prefix=/usr/local CPPFLAGS="-I/usr/include/sys -I/usr/local/include/"

after making a symlink to the header where the autoconf tools in this
distribution want it...

ln -s /usr/local/include/openvpn-plugin.h /usr/include/openvpn-plugin.h

This is assuming that openvpn was installed from ports or the official
FreeBSD pkg. The plugin directory above is the FreeBSD port/pkg default.

I built it successfully, but haven't tested yet. Here are the warnings...

otp.c:125:35: warning: implicitly declaring library function 'isspace' with type 'int (int)' [-Wimplicit-function-declaration]
while (!feof(secrets_file) && isspace((ch = fgetc(secrets_file)))) {
^
otp.c:125:35: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'
otp.c:277:17: warning: passing 'unsigned char *' to parameter of type 'char ' converts between pointers to integer types with different sign
[-Wpointer-sign]
sprintf(&hexdigest[i
2], "%02x", hash[i]);
^~~~~~~~~~~~~~~
/usr/include/stdio.h:277:31: note: passing argument to parameter here
int sprintf(char * __restrict, const char * __restrict, ...);
^
otp.c:310:17: warning: passing 'unsigned char *' to parameter of type 'char ' converts between pointers to integer types with different sign
[-Wpointer-sign]
sprintf(&hexdigest[i
2], "%02x", hash[i]);
^~~~~~~~~~~~~~~
/usr/include/stdio.h:277:31: note: passing argument to parameter here
int sprintf(char * __restrict, const char * __restrict, ...);
^
otp.c:420:18: warning: implicit declaration of function 'time' is invalid in C99 [-Wimplicit-function-declaration]
T = (time(NULL) - totp_t0) / tstep;
^
4 warnings generated.

Will post back after testing.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/evgeny-gridasov/openvpn-otp/issues/18#issuecomment-398921554,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC2b1UaOhkLbpFdS64R1BxT7fUIf1Gk-ks5t-tENgaJpZM4OqZzR
.

<!-- gh-comment-id:398940087 --> @evgeny-gridasov commented on GitHub (Jun 21, 2018): Hey Robert, I've done zero testing on FreeBSD, and while I still like the OS, I have no free time to test that. I am sure somebody else had some success in it. You're welcome to provide a fix via a pull request. Regards, Evgeny. On Thursday, June 21, 2018, Robert Clayton <notifications@github.com> wrote: > Stumbled on this via google. Warnings during compile using suggestions in this > reply > <https://github.com/evgeny-gridasov/openvpn-otp/issues/18#issuecomment-327415413> > about machine/ being deprecated in favor of sys/ (on FreeBSD 11.1-RELEASE). > There is a hard-coded search path for /usr/include somewhere, because > prefixing /usr/local as FreeBSD uses does not find the openvpn headers. > > So my modified configure was... > > ./configure --with-openvpn-plugin-dir=/usr/local/lib/openvpn/plugins > --prefix=/usr/local CPPFLAGS="-I/usr/include/sys -I/usr/local/include/" > > after making a symlink to the header where the autoconf tools in this > distribution want it... > > ln -s /usr/local/include/openvpn-plugin.h /usr/include/openvpn-plugin.h > > This is assuming that openvpn was installed from ports or the official > FreeBSD pkg. The plugin directory above is the FreeBSD port/pkg default. > > I built it successfully, but haven't tested yet. Here are the warnings... > > otp.c:125:35: warning: implicitly declaring library function 'isspace' with type 'int (int)' [-Wimplicit-function-declaration] > while (!feof(secrets_file) && isspace((ch = fgetc(secrets_file)))) { > ^ > otp.c:125:35: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace' > otp.c:277:17: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign > [-Wpointer-sign] > sprintf(&hexdigest[i*2], "%02x", hash[i]); > ^~~~~~~~~~~~~~~ > /usr/include/stdio.h:277:31: note: passing argument to parameter here > int sprintf(char * __restrict, const char * __restrict, ...); > ^ > otp.c:310:17: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign > [-Wpointer-sign] > sprintf(&hexdigest[i*2], "%02x", hash[i]); > ^~~~~~~~~~~~~~~ > /usr/include/stdio.h:277:31: note: passing argument to parameter here > int sprintf(char * __restrict, const char * __restrict, ...); > ^ > otp.c:420:18: warning: implicit declaration of function 'time' is invalid in C99 [-Wimplicit-function-declaration] > T = (time(NULL) - totp_t0) / tstep; > ^ > 4 warnings generated. > > Will post back after testing. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/evgeny-gridasov/openvpn-otp/issues/18#issuecomment-398921554>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AC2b1UaOhkLbpFdS64R1BxT7fUIf1Gk-ks5t-tENgaJpZM4OqZzR> > . >
Author
Owner

@evgeny-gridasov commented on GitHub (Nov 29, 2018):

I've added FreeBSD and OpenBSD support in github.com/evgeny-gridasov/openvpn-otp@922d12379c

<!-- gh-comment-id:442776165 --> @evgeny-gridasov commented on GitHub (Nov 29, 2018): I've added FreeBSD and OpenBSD support in https://github.com/evgeny-gridasov/openvpn-otp/commit/922d12379c1f3e13cbe4256b4dd3e3c8caf22277
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/openvpn-otp#10
No description provided.