Compare commits

...

22 Commits

Author SHA1 Message Date
Hibby 78f78927ab
Release new version 2025-08-17 22:40:01 +01:00
Hibby 27d95452b1 Update upstream source from tag 'upstream/6.0.24.82+repack'
Update to upstream version '6.0.24.82+repack'
with Debian dir a145ad04db
2025-08-17 22:31:33 +01:00
Hibby e925e16114 New upstream version 6.0.24.82+repack 2025-08-17 22:31:27 +01:00
Hibby d97d9d821b
Commit before next update! 2025-08-17 22:30:20 +01:00
Hibby a6b3c4bdc9 Update upstream source from tag 'upstream/6.0.24.80+repack'
Update to upstream version '6.0.24.80+repack'
with Debian dir 9e943f8d36
2025-08-12 20:09:07 +01:00
Hibby 3e1cbdfa4d New upstream version 6.0.24.80+repack 2025-08-12 20:09:04 +01:00
Hibby 7a5122a60f
Changelog for release, makefile patch refresh 2025-07-31 01:31:52 +01:00
Hibby 0013c3199a Update upstream source from tag 'upstream/6.0.24.78+repack'
Update to upstream version '6.0.24.78+repack'
with Debian dir 819c1fdecb
2025-07-31 01:28:57 +01:00
Hibby fa3201d982 New upstream version 6.0.24.78+repack 2025-07-31 01:28:54 +01:00
Hibby 5d30fbc104
New files to exclude 2025-07-31 01:28:13 +01:00
Hibby e21707174e
Release! 2025-07-22 21:52:16 +01:00
Hibby 26324bdc39
First build 2025-07-22 21:44:33 +01:00
Hibby 1cc87cf766 Update upstream source from tag 'upstream/6.0.24.77+repack'
Update to upstream version '6.0.24.77+repack'
with Debian dir bbbd57413e
2025-07-22 20:57:03 +01:00
Hibby 1f40ff4a07 New upstream version 6.0.24.77+repack 2025-07-22 20:56:59 +01:00
Hibby 30b1e26a04
Did a port on minibuildd for +1, this is technically +2 2025-07-16 19:16:00 +01:00
Hibby 31bda6ce76
Trixie release 2025-07-16 19:11:08 +01:00
Hibby d2c3489aef
Release 2025-07-15 01:11:11 +01:00
Hibby 6371d5385a Update upstream source from tag 'upstream/6.0.24.75+repack'
Update to upstream version '6.0.24.75+repack'
with Debian dir 8aa30a6de8
2025-07-14 23:14:14 +01:00
Hibby 8d3874ec4e
Update d/copyright to ignore svn 2025-07-14 23:12:11 +01:00
Hibby 6a4b588a48
Release and autoport magic 2025-05-21 22:12:07 +01:00
Hibby 426f47ccb6
It builds successfully! 2025-05-21 21:45:54 +01:00
Hibby 3ecb593511 Update upstream source from tag 'upstream/6.0.24.71+repack'
Update to upstream version '6.0.24.71+repack'
with Debian dir d79186aef0
2025-05-21 21:33:54 +01:00
51 changed files with 930 additions and 65 deletions

View File

@ -49,7 +49,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#define DM 0x0F
#define UA 0x63
#define FRMR 0x87
#define XID 0xAF
#define XID 0xAF
#define TEST 0xE3
#define RR 1
#define RNR 5
@ -267,16 +267,16 @@ int InternalAGWDecodeFrame(MESSAGE * msg, char * buffer, time_t Stamp, int * Fra
FRMRFLAG = 1;
break;
case XID:
strcpy(SUP, "XID");
XIDFLAG = 1;
break;
case TEST:
strcpy(SUP, "TEST");
TESTFLAG = 1;
case XID:
strcpy(SUP, "XID");
XIDFLAG = 1;
break;
case TEST:
strcpy(SUP, "TEST");
TESTFLAG = 1;
break;
}

View File

@ -1154,6 +1154,7 @@
// Add Send and Receive byte counts to status displays (69)
// Validate Mode and Frequency and fix formatting in Connected Message (71)
// Fix using OpenBCM on other than Telnet connections (75)
// Fix sending + in Webmail (80)
#include "bpqmail.h"
#include "winstdint.h"

View File

@ -2973,6 +2973,30 @@ LRESULT APIENTRY InputProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
}
if (wParam == 0x7) // BEL (Ctrl/G)
{
// Get buffer, append 07 and write back
Cinfo->kbptr = SendMessage(Cinfo->hwndInput, WM_GETTEXT, INPUTLEN-1,
(LPARAM) (LPCSTR)Cinfo->kbbuf);
Cinfo->kbbuf[Cinfo->kbptr++] = 7;
Cinfo->kbbuf[Cinfo->kbptr] = 0;
SendMessage(Cinfo->hwndInput,WM_SETTEXT,0,(LPARAM)(LPCSTR) Cinfo->kbbuf);
// Send cursor right
for (i = 0; i < strlen(Cinfo->kbbuf); i++)
{
SendMessage(Cinfo->hwndInput, WM_KEYDOWN, VK_RIGHT, 0);
SendMessage(Cinfo->hwndInput, WM_KEYUP, VK_RIGHT, 0);
}
return 0;
}
}

View File

@ -1275,7 +1275,13 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Fix 64 bit compatiblility issues with AGWAPI (73)
// Fix KAM Pactor Interlock (73)
// Fix Node map reporting, broken in .73 (74)
// Fixes to build on FreeBSD and NetBSD from jg1uaa (77)
// Fix to L4Compress from Steve G7TAJ (77)
// Fix possible FRMR when RNR is cleared by SREJ (78)
// Fix error in .77 L4Compress fix (mine, not Steve's!) (78)
// Fix possible stuck L2 session when handling SREJ (79)
// Allow sending CTRL/G From console (Windows) (80)
// Fix Webmail autorefresh extra threads problem (websock connection lost handling) (82)
#define CKernel

View File

@ -983,7 +983,30 @@ LRESULT APIENTRY InputProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
}
if (wParam == 0x7) // BEL (Ctrl/G)
{
// Get buffer, append 07 and write back
Cinfo->kbptr = SendMessage(Cinfo->hwndInput, WM_GETTEXT, INPUTLEN-1,
(LPARAM) (LPCSTR)Cinfo->kbbuf);
Cinfo->kbbuf[Cinfo->kbptr++] = 7;
Cinfo->kbbuf[Cinfo->kbptr] = 0;
SendMessage(Cinfo->hwndInput,WM_SETTEXT,0,(LPARAM)(LPCSTR) Cinfo->kbbuf);
// Send cursor right
for (i = 0; i < strlen(Cinfo->kbbuf); i++)
{
SendMessage(Cinfo->hwndInput, WM_KEYDOWN, VK_RIGHT, 0);
SendMessage(Cinfo->hwndInput, WM_KEYUP, VK_RIGHT, 0);
}
return 0;
}
}
return CallWindowProc(Cinfo->wpOrigInputProc, hwnd, uMsg, wParam, lParam);

2
ChatUsers.txt Normal file
View File

@ -0,0 +1,2 @@
GM8BPQ 0 John ?_qthャ26ャ0
G8BPQ 0 John ?_qthャ26ャ0

View File

@ -4839,7 +4839,14 @@ void ProcessWebmailWebSockThread(void * conn)
Sent = send(sockptr->socket, _REPLYBUFFER, ReplyLen, 0);
while (Sent != ReplyLen && Loops++ < 3000) // 100 secs max
if (Sent == -1) // Connecton lost
{
closesocket(sockptr->socket);
free(conn);
return;
}
while (Sent != ReplyLen && Loops++ < 3000) // 90 secs max
{
if (Sent > 0) // something sent
{
@ -4885,11 +4892,16 @@ void ProcessWebmailWebSockThread(void * conn)
CloseHandle(hPipe);
// ?? do we need a thread to handle write which may block
Sent = send(sockptr->socket, Reply, ReplyLen, 0);
while (Sent != ReplyLen && Loops++ < 3000) // 100 secs max
if (Sent == -1) // Connecton lost
{
free(conn);
closesocket(sockptr->socket);
return;
}
while (Sent != ReplyLen && Loops++ < 3000) // 90 secs max
{
// Debugprintf("%d out of %d sent %d Loops", Sent, InputLen, Loops);

View File

@ -1229,7 +1229,7 @@ void chkctl(ChatCIRCUIT *ckt_from, char * Buffer, int Len)
for (i = 1; i < (Len - 1); i++)
{
if (Buffer[i] < 32)
if (Buffer[i] < 32 && Buffer[i] != 7) // Accept BELL
{
if (Buffer[i] == 9)
{

View File

@ -100,7 +100,10 @@ TODo ?Multiple Adapters
#ifdef WIN32
int pcap_sendpacket(pcap_t *p, u_char *buf, int size);
#else
PCAP_API int pcap_sendpacket(pcap_t *, const u_char *, int);
#ifndef PCAP_API
#define PCAP_API extern
#endif
PCAP_API int pcap_sendpacket(pcap_t *, const u_char *, int);
#endif
#ifndef LINBPQ

View File

@ -2176,7 +2176,9 @@ VOID SFRAME(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, UCHAR CTL, UCHA
int count;
MESSAGE * Msg;
MESSAGE * Buffer;
LINK->L2FLAGS &= ~POLLSENT; // CLEAR I(P) or RR(P) SET
Msg = LINK->FRAMES[NS]; // is frame available?
if (Msg == NULL)
@ -2977,6 +2979,43 @@ VOID SDETX(struct _LINKTABLE * LINK)
// if (LINK->L2RESEQ_Q)
// return;
// **** Debug code **** look for stuck links
if (LINK->LASTFRAMESENT && (time(NULL) - LINK->LASTFRAMESENT) > 60) // No send for 60 secs
{
if (COUNT_AT_L2(LINK) > 16)
{
// Dump Link State
char Normcall[11] = "";
char Normcall2[11] = "";
int Count = COUNT_AT_L2(LINK);
int secs = time(NULL) - LINK->LASTFRAMESENT;
ConvFromAX25(LINK->LINKCALL, Normcall);
ConvFromAX25(LINK->OURCALL, Normcall2);
Debugprintf("*** Stuck L2 Session for %d Secs %s %s %d", secs, Normcall, Normcall2, Count);
Debugprintf("LINK->LINKNS %d LINK->LINKOWS %d SDTSLOT %d LINKWINDOW %d L2FLAGS %d", LINK->LINKNS, LINK->LINKOWS, LINK->SDTSLOT, LINK->LINKWINDOW, LINK->L2FLAGS);
Debugprintf("Slots %x %x %x %x %x %x %x %x", LINK->FRAMES[0], LINK->FRAMES[1], LINK->FRAMES[2], LINK->FRAMES[3],
LINK->FRAMES[4], LINK->FRAMES[5], LINK->FRAMES[6], LINK->FRAMES[7]);
// Reset Link
InformPartner(LINK, NORMALCLOSE); // TELL OTHER END ITS GONE
LINK->L2RETRIES -= 1; // Just send one DISC
LINK->L2STATE = 4; // CLOSING
L2SENDCOMMAND(LINK, DISC | PFBIT);
return;
}
}
Outstanding = LINK->LINKNS - LINK->LINKOWS; // Was WS not NS
if (Outstanding < 0)
@ -2994,6 +3033,10 @@ VOID SDETX(struct _LINKTABLE * LINK)
Msg = Q_REM(&LINK->TX_Q);
Msg->CHAIN = NULL;
LINK->LASTFRAMESENT = time(NULL);
LINK->LASTSENTQCOUNT = COUNT_AT_L2(LINK);
if (LINK->AllowCompress && Msg->LENGTH > 20 && LINK->TX_Q && Msg->PID == 240) // if short and no more not worth trying compression
{
int complen = 0;
@ -3018,6 +3061,7 @@ VOID SDETX(struct _LINKTABLE * LINK)
// I think I need to know how many slots are available, so I don't compress too much
// Then collect data, compressing after each frame to make sure will fit in available space
while (LINK->FRAMES[n] == NULL && slots < 8)
{
slots++;
@ -3281,7 +3325,7 @@ VOID L2TimerProc()
LINK->L2ACKREQ = 0; // CLEAR ANY DELAYED ACK TIMER
if (LINK->L2RETRIES == 0) // IF RR(P) OUTSTANDING WILl REPORT ANYWAY
if (LINK->L2RETRIES == 0) // IF RR(P) OUTSTANDING WILL REPORT ANYWAY
{
SendSupervisCmd(LINK);
LINK++;
@ -3904,6 +3948,7 @@ UINT RR_OR_RNR(struct _LINKTABLE * LINK)
{
UCHAR Temp;
TRANSPORTENTRY * Session;
int SaveRNRSent = LINK->L2FLAGS & RNRSENT;
LINK->L2FLAGS &= ~RNRSENT;
@ -3979,6 +4024,11 @@ stayinREJ2:
// if we support SREJ send that instesd or REJ
// Dont send SREJ if clearing RNR - causes FRMR
if (SaveRNRSent)
return REJ;
if (LINK->Ver2point2) // We only allow 2.2 with SREJ Multi
return SREJ;
else

View File

@ -797,8 +797,6 @@ VOID L4BG()
// Fragment if more than L4CompPaclen
// Entered with original first fragment in saveMsg;
// Check for too big a compressed frame size. Bigger compresses better but adds latency to link
maxCompSendLen = L4CompPaclen * L4CompMaxframe;
@ -826,9 +824,8 @@ VOID L4BG()
int Len = bytesleft;
if (Len > ChunkSize)
Len = ChunkSize;
complen = L2Compressit(Compressed, 8192, toCompress, toCompressLen);
complen = L2Compressit(Compressed, 8192, CompressPtr, Len);
Debugprintf("Chunked %d %d %d%%", Len, complen, ((Len - complen) * 100) / Len);
sendChunk(L4, Compressed, complen, savePort);

View File

@ -913,7 +913,10 @@ int main(int argc, char * argv[])
Debugprintf("G8BPQ AX25 Packet Switch System Version %s %s", TextVerstring, Datestring);
#ifndef MACBPQ
#if defined(MACBPQ) || defined(FREEBSD)
time_t dummy;
_MYTIMEZONE = -localtime(&dummy)->tm_gmtoff;
#else
_MYTIMEZONE = _timezone;
#endif

View File

@ -944,6 +944,30 @@ LRESULT APIENTRY InputProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
}
if (wParam == 0x7) // BEL (Ctrl/G)
{
// Get buffer, append 07 and write back
Cinfo->kbptr = SendMessage(Cinfo->hwndInput, WM_GETTEXT, INPUTLEN-1,
(LPARAM) (LPCSTR)Cinfo->kbbuf);
Cinfo->kbbuf[Cinfo->kbptr++] = 7;
Cinfo->kbbuf[Cinfo->kbptr] = 0;
SendMessage(Cinfo->hwndInput,WM_SETTEXT,0,(LPARAM)(LPCSTR) Cinfo->kbbuf);
// Send cursor right
for (i = 0; i < strlen(Cinfo->kbbuf); i++)
{
SendMessage(Cinfo->hwndInput, WM_KEYDOWN, VK_RIGHT, 0);
SendMessage(Cinfo->hwndInput, WM_KEYUP, VK_RIGHT, 0);
}
return 0;
}
}

Binary file not shown.

Binary file not shown.

1
RTKnown.txt Normal file
View File

@ -0,0 +1 @@
G8BPQ-1 1754642136

View File

@ -241,8 +241,14 @@ typedef struct _SERIAL_STATUS {
#ifndef WIN32
#ifdef MACBPQ
#if defined(MACBPQ)
#include <util.h>
#elif defined(FREEBSD)
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <libutil.h>
#else
#include <util.h>
#endif
#endif
extern int posix_openpt (int __oflag);
@ -262,7 +268,7 @@ HANDLE LinuxOpenPTY(char * Name)
u_long param=1;
struct termios term;
#ifdef MACBPQ
#if defined(MACBPQ) || defined(FREEBSD)
// Create a pty pair

View File

@ -5018,23 +5018,20 @@ int DataSocket_ReadHTTP(struct TNCINFO * TNC, struct ConnectionInfo * sockptr, S
{
// Failed or closed - clear connection
// if Websock connection till app
// if Websock connection tell app
if (sockptr->WebSocks)
{
if (memcmp(sockptr->WebURL, "rhp", 3) == 0)
{
ProcessRHPWebSockClosed(sockptr->socket);
DataSocket_Disconnect(TNC, sockptr);
return 0;
}
}
else
{
TNC->Streams[sockptr->Number].ReportDISC = TRUE; //Tell Node
DataSocket_Disconnect(TNC, sockptr);
return 0;
}
TNC->Streams[sockptr->Number].ReportDISC = TRUE; //Tell Node
DataSocket_Disconnect(TNC, sockptr);
return 0;
}
MsgPtr = &sockptr->InputBuffer[0];

View File

@ -10,15 +10,15 @@
#endif
#define KVers 6,0,24,75
#define KVerstring "6.0.24.75\0"
#define KVers 6,0,24,82
#define KVerstring "6.0.24.82\0"
#ifdef CKernel
#define Vers KVers
#define Verstring KVerstring
#define Datestring "June 2025"
#define Datestring "August 2025"
#define VerComments "G8BPQ Packet Switch (C Version)" KVerstring
#define VerCopyright "Copyright © 2001-2025 John Wiseman G8BPQ\0"
#define VerDesc "BPQ32 Switch\0"

View File

@ -2662,10 +2662,10 @@ VOID SaveNewMessage(struct HTTPConnectionInfo * Session, char * MsgPtr, char * R
if (strlen(WebMail->BID) > 12)
WebMail->BID[12] = 0;
UndoTransparency(WebMail->BID);
UndoTransparency(WebMail->To);
UndoTransparency(WebMail->Subject);
UndoTransparency(WebMail->Body);
// UndoTransparency(WebMail->BID);
// UndoTransparency(WebMail->To);
// UndoTransparency(WebMail->Subject);
// UndoTransparency(WebMail->Body);
MsgLen = strlen(WebMail->Body);

View File

@ -930,6 +930,9 @@ typedef struct _LINKTABLE
VOID * FRAMES[8]; // FRAMES WAITING ACK
VOID * RXFRAMES[8]; // Frames received out of sequence
time_t LASTFRAMESENT; // For detecting stuck links
int LASTSENTQCOUNT; //
UCHAR L2STATE; // PROCESSING STATE
UCHAR Ver2point2; // Set if running 2.2
USHORT L2TIMER; // FRAME RETRY TIMER
@ -1087,7 +1090,11 @@ struct SEM
int Gets;
int Rels;
DWORD SemProcessID;
#ifdef WIN32
DWORD SemThreadID;
#else
pthread_t SemThreadID;
#endif
int Line; // caller file and line
char File[MAX_PATH];
};

View File

@ -73,6 +73,9 @@
//.25
// Increase size of status display buffers (7)
// Allow sending BEL (CTRL/G) (79)
// Fix sending BEL (CTRL/G) (81)
#include "BPQChat.h"
#include "Dbghelp.h"

45
cMain.c
View File

@ -52,6 +52,9 @@ int CanPortDigi(int Port);
int KissEncode(UCHAR * inbuff, UCHAR * outbuff, int len);
void MQTTTimer();
void SaveMH();
VOID InformPartner(struct _LINKTABLE * LINK, int Reason);
VOID L2SENDCOMMAND(struct _LINKTABLE * LINK, int CMD);
#include "configstructs.h"
@ -62,6 +65,7 @@ extern int needADSB;
struct PORTCONFIG * PortRec;
#define RNRSET 0x2 // RNR RECEIVED FROM OTHER END
#define PFBIT 0x10 // POLL/FINAL BIT IN CONTROL BYTE
// STATION INFORMATION
@ -2506,6 +2510,47 @@ ENDOFLIST:
if ((LINK->L2FLAGS & RNRSET) == 0)
SDETX(LINK);
else
{
// Stuck link debug check
if (LINK->LASTFRAMESENT && (time(NULL) - LINK->LASTFRAMESENT) > 60) // No send for 60 secs
{
if (COUNT_AT_L2(LINK) > 16)
{
// Dump Link State
char Normcall[11] = "";
char Normcall2[11] = "";
int Count = COUNT_AT_L2(LINK);
int secs = time(NULL) - LINK->LASTFRAMESENT;
ConvFromAX25(LINK->LINKCALL, Normcall);
ConvFromAX25(LINK->OURCALL, Normcall2);
Debugprintf("*** Stuck L2 Session for %d Secs RNR Set %s %s %d", secs, Normcall, Normcall2, Count);
Debugprintf("LINK->LINKNS %d LINK->LINKOWS %d SDTSLOT %d LINKWINDOW %d L2FLAGS %d", LINK->LINKNS, LINK->LINKOWS, LINK->SDTSLOT, LINK->LINKWINDOW, LINK->L2FLAGS);
Debugprintf("Slots %x %x %x %x %x %x %x %x", LINK->FRAMES[0], LINK->FRAMES[1], LINK->FRAMES[2], LINK->FRAMES[3],
LINK->FRAMES[4], LINK->FRAMES[5], LINK->FRAMES[6], LINK->FRAMES[7]);
// Reset Link
InformPartner(LINK, NORMALCLOSE); // TELL OTHER END ITS GONE
LINK->L2RETRIES -= 1; // Just send one DISC
LINK->L2STATE = 4; // CLOSING
L2SENDCOMMAND(LINK, DISC | PFBIT);
return;
}
}
}
}
}
LINK++;

View File

@ -18,5 +18,5 @@ Chat :
MonitorSize = "828,1644,148,770";
DebugSize = "0,0,0,0";
WindowSize = "231,835,254,602";
Version = "6,0,24,32";
Version = "6,0,24,81";
};

11
debian/NEWS vendored Normal file
View File

@ -0,0 +1,11 @@
linbpq (6.0.24.22-2) unstable; urgency=medium
This is quite a big update, with config moving from /opt/oarc/bpq/bpq32.cfg to
/etc/bpq32.cfg. The system shall do this automatically for you, however
computers and their programmers are not perfect.
I strongly recommend at this point backing up your entire
/opt/oarc/bpq/ directory (cp -r /opt/oarc/bpq/ ~/bpq-backup/) before
proceeding with the upgrade
-- Dave Hibberd <d@vehibberd.com> Sat, 16 Dec 2023 13:30:06 +0000

23
debian/README.Debian vendored Normal file
View File

@ -0,0 +1,23 @@
README for linbpq on Debian
===========================
Please see https://wiki.oarc.uk/packet:linbpq-apt-installation for this guide
# Set config
Copy the config, edit it & set permissions.
The permissions are so linbpq web interface can edit the config.
sudo mv /usr/share/doc/linbpq/examples/bpq32.cfg /etc/bpq32.cfg
sudo nano /etc/bpq32.cfg
sudo chown :linbpq /etc/bpq32.cfg
sudo chmod 644 /etc/bpq32.cfg
# Start linbpq
sudo systemctl start linbpq
# Access your node
It shall be available by accessing http://localhost:8008 in the browser or telnet localhost 8010
-- Dave Hibberd <hibby@debian.org> Tue, 26 Mar 2024 00:53:42 +0000

50
debian/bpq32.cfg vendored Normal file
View File

@ -0,0 +1,50 @@
SIMPLE
NODECALL=MB7NAA
NODEALIAS=AANODE
LOCATOR=AA00aa
PASSWORD=xxxxxxxx
AUTOSAVE=1
NODESINTERVAL=10
MINQUAL=10
CTEXT:
Thanks for connecting.
Type ? for help.
***
PORT
PORTNUM=1
ID=VHF
TYPE=ASYNC
PROTOCOL=KISS
KISSOPTIONS=ACKMODE
COMPORT=/dev/ttyACM0
SPEED=57600
FRACK=4000
PACLEN=150
DIGIFLAG=0
QUALITY=192
MINQUAL=20
ENDPORT
PORT
PORTNUM=9
ID=Telnet
DRIVER=Telnet
CONFIG
LOGGING=1
CMS=1
DisconnectOnClose=1
SECURETELNET=1
TCPPORT=8010
FBBPORT=8011
HTTPPORT=8008
LOGINPROMPT=user:
PASSWORDPROMPT=password:
MAXSESSIONS=10
CTEXT=Thanks for connecting\n Enter ? for list of commands\n\n
USER=username,xxxxxxxx,m0aaa,,SYSOP
ENDPORT
LINCHAT
APPLICATION 2,CHAT,,MB7NAA-9,AACHAT,255

297
debian/changelog vendored Normal file
View File

@ -0,0 +1,297 @@
linbpq (6.0.24.82+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
* New upstream version 6.0.24.82+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Sun, 17 Aug 2025 22:36:49 +0100
linbpq (6.0.24.78+repack-1~hibbian~TRIXIE+1) trixie-hibbian-unstable; urgency=medium
* New Upstream
* New files excluded
- No binaries in this release at all maybe!
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Thu, 31 Jul 2025 01:31:38 +0100
linbpq (6.0.24.77+repack-1~hibbian~TRIXIE+1) trixie-hibbian-unstable; urgency=medium
* New upstream version 6.0.24.77+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Tue, 22 Jul 2025 21:46:13 +0100
linbpq (6.0.24.75+repack-1~hibbian~TRIXIE+2) trixie-hibbian-unstable; urgency=medium
* First trixie release
* Drop hard-dep on hibbian-archive-keyring
-- Dave Hibberd <hibby@debian.org> Wed, 16 Jul 2025 19:10:33 +0100
linbpq (6.0.24.75+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream version 6.0.25.75+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Tue, 15 Jul 2025 01:10:43 +0100
linbpq (6.0.24.71+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream version 6.0.24.67+repack
* New upstream version 6.0.24.69+repack
* New upstream version 6.0.24.69.1+repack
* New upstream version 6.0.24.71+repack
* Okay that's a lot of updates.
* Refreshed d/p/makefile to reflect new CFLAG
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Wed, 21 May 2025 21:45:59 +0100
linbpq (6.0.24.66+repack-1~hibbian+2) bookworm-hibbian-unstable; urgency=medium
* Update postinst script to be a little quieter
* MINI_BUILDD_OPTION:
auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Tue, 11 Mar 2025 00:51:35 +0000
linbpq (6.0.24.66+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream version 6.0.24.66+repack
-- Dave Hibberd <hibby@debian.org> Tue, 04 Mar 2025 22:50:09 +0000
linbpq (6.0.24.65+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
-- Dave Hibberd <hibby@debian.org> Tue, 25 Feb 2025 09:33:24 +0000
linbpq (6.0.24.59a+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
* Little tweaks to makefile patch to account for new -rdynamic
-- Dave Hibberd <hibby@debian.org> Mon, 03 Feb 2025 22:32:11 +0000
linbpq (6.0.24.56+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
-- Dave Hibberd <hibby@debian.org> Mon, 06 Jan 2025 21:37:44 +0000
linbpq (6.0.24.55+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
* d/rules
- Increased hardening
-- Dave Hibberd <hibby@debian.org> Sun, 05 Jan 2025 23:35:06 +0000
linbpq (6.0.24.54+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
* Drop AGW Patch
* Drop Spelling Patch
* Drop Dynamic Links patch
-- Dave Hibberd <hibby@debian.org> Tue, 17 Dec 2024 16:46:05 +0000
linbpq (6.0.24.53+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream
- Patches refreshed
- dropped some edits in ftbfs-gcc14
- dropped d/patches/headers.patch
-- Dave Hibberd <hibby@debian.org> Tue, 03 Dec 2024 00:57:57 +0000
linbpq (6.0.24.52+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream
- Patches happy
-- Dave Hibberd <hibby@debian.org> Sat, 30 Nov 2024 21:47:17 +0000
linbpq (6.0.24.51.1+repack-1~hibbian+2) bookworm-hibbian-unstable; urgency=medium
* Iron out an issue with time...
-- Dave Hibberd <hibby@debian.org> Fri, 29 Nov 2024 19:57:28 +0000
linbpq (6.0.24.51.1+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream import after bug report
* Roll back some ftbfs-gcc14 edits
* Remove some more lib headers
-- Dave Hibberd <hibby@debian.org> Fri, 29 Nov 2024 19:30:22 +0000
linbpq (6.0.24.51+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream import
- Patches refreshed
* Upstream is now repacked to include less files
* Big build system review, now using Debian CFLAGS and LDFLAGS
- Hardening enabled, mostly
- A debug symbols package is now available
* Oh yeah, everything is now dynamic linking
- libpng
- libpaho-mqtt
- libjansson
- libminiupnpc
-- Dave Hibberd <hibby@debian.org> Fri, 29 Nov 2024 13:08:38 +0000
linbpq (6.0.24.50-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream import
* Files excluded at origtargz generation time for cleanliness
-- Dave Hibberd <hibby@debian.org> Tue, 12 Nov 2024 21:56:38 +0000
linbpq (6.0.24.49-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream import
* Patches refreshed
* Add mqtt requirements
-- Dave Hibberd <hibby@debian.org> Tue, 05 Nov 2024 21:52:29 +0000
linbpq (6.0.24.45-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream import
* Patches refreshed
-- Dave Hibberd <hibby@debian.org> Fri, 11 Oct 2024 15:48:41 +0100
linbpq (6.0.24.42-1~hibbian+3) bookworm-hibbian-unstable; urgency=medium
* 32bit build error
- Patch updated to fix hopefully
-- Dave Hibberd <hibby@debian.org> Fri, 30 Aug 2024 12:21:57 +0100
linbpq (6.0.24.42-1~hibbian+2) bookworm-hibbian-unstable; urgency=medium
* Forgot to fix the ninotnc-smt issue, fixed now
-- Dave Hibberd <hibby@debian.org> Fri, 30 Aug 2024 12:05:54 +0100
linbpq (6.0.24.42-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* Install config to /etc
* New upstream update
* Patches refreshed
* Debian hardening enabled
- 2 new patches created that touch almost every file
- Considered experimental.
- gcc14 builds for Debian Trixie!
-- Dave Hibberd <hibby@debian.org> Fri, 30 Aug 2024 10:15:11 +0100
linbpq (6.0.24.40-1) unstable; urgency=medium
* Fresh upstream release
- Patches refreshed
* Secure by default patch
-- Dave Hibberd <hibby@debian.org> Sun, 07 Jul 2024 16:09:28 +0100
linbpq (6.0.24.38-1) unstable; urgency=medium
* New Upstream
* Tweak config file per recommendation from 2M0MQN to make first start simple
* Bump standards to 4.7.0.0
-- Dave Hibberd <hibby@debian.org> Sun, 09 Jun 2024 22:38:40 +0100
linbpq (6.0.24.34-2) unstable; urgency=medium
* Fix config permissions bug as reported by Alex 2E1PKY
-- Dave Hibberd <hibby@debian.org> Mon, 08 Apr 2024 22:27:02 +0100
linbpq (6.0.24.34-1) unstable; urgency=medium
* Upstream bump
-- Dave Hibberd <hibby@debian.org> Sat, 06 Apr 2024 02:15:28 +0100
linbpq (6.0.24.33-1) unstable; urgency=medium
* Upstream bump
* Moved config file to examples
* Updated service to fail on no config
* Added helpful README.Debian
-- Dave Hibberd <hibby@debian.org> Tue, 26 Mar 2024 20:24:08 +0000
linbpq (6.0.24.30-1) unstable; urgency=medium
* Upstream bump
-- Dave Hibberd <hibby@debian.org> Fri, 23 Feb 2024 23:24:46 +0000
linbpq (6.0.24.29-1) unstable; urgency=medium
* Upstream bump
* Added my new details
* Tidied up some packaging errors
-- Dave Hibberd <hibby@debian.org> Tue, 13 Feb 2024 00:06:33 +0000
linbpq (6.0.24.27-2) unstable; urgency=medium
* Permissions fix for web-config-editor users
-- Dave Hibberd <d@vehibberd.com> Thu, 18 Jan 2024 10:31:56 +0000
linbpq (6.0.24.27-1) unstable; urgency=medium
* New Upstream Release
-- Dave Hibberd <d@vehibberd.com> Tue, 16 Jan 2024 20:51:43 +0000
linbpq (6.0.24.25-1) unstable; urgency=medium
* New Upstream Release
-- Dave Hibberd <d@vehibberd.com> Thu, 28 Dec 2023 10:44:47 +0000
linbpq (6.0.24.22-2) unstable; urgency=medium
* Moved config file home, caused chaos
-- Dave Hibberd <d@vehibberd.com> Sat, 16 Dec 2023 14:40:20 +0000
linbpq (6.0.24.22-1) unstable; urgency=medium
* New Upstream Release
-- Dave Hibberd <d@vehibberd.com> Fri, 08 Dec 2023 12:29:40 +0000
linbpq (6.0.24.16-1) unstable; urgency=medium
* New Upstream release
-- Dave Hibberd <d@vehibberd.com> Tue, 31 Oct 2023 22:50:01 +0000
linbpq (6.0.24.15-2) unstable; urgency=medium
* debian/conffiles introduced to stop linbpq overwriting config files
- Thanks to Mark 2M0IIG for raising concern about this bug!
-- Dave Hibberd <d@vehibberd.com> Sun, 15 Oct 2023 21:45:24 +0100
linbpq (6.0.24.15-1) unstable; urgency=medium
* New upstream release
-- Dave Hibberd <d@vehibberd.com> Tue, 10 Oct 2023 22:19:48 +0100
linbpq (6.0.24.2-1) unstable; urgency=medium
* Initial release.
-- Dave Hibberd <d@vehibberd.com> Mon, 28 Aug 2023 23:20:45 +0100

20
debian/control vendored Normal file
View File

@ -0,0 +1,20 @@
Source: linbpq
Section: hamradio
Priority: optional
Maintainer: Dave Hibberd <hibby@debian.org>
Standards-Version: 4.7.2
Vcs-Browser: https://git.hibbian.org/Hibbian/linbpq
Vcs-Git: https://git.hibbian.org/Hibbian/linbpq.git
Homepage: https://www.cantab.net/users/john.wiseman/Documents/
Build-Depends: debhelper-compat (= 13)
Build-Depends-Arch: libssl-dev, libminiupnpc-dev, libpcap-dev, libconfig-dev, zlib1g-dev, libpaho-mqtt-dev, libjansson-dev, libpng-dev
Rules-Requires-Root: no
Package: linbpq
Architecture: linux-any
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
Description: Packet node and ax25 stack
LINBPQ is a Linux version of the BPQ32 Node, BBS and Chat Server components.
It is actively developed by John G8BPQ and contains a complete, independent
implementation of ax.25 and net/rom as well as BBS and Chat applications and
can be used either as a packet switch or as a full featured node.

37
debian/copyright vendored Normal file
View File

@ -0,0 +1,37 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: linBPQ
Upstream-Contact: John Wiseman G8BPQ <john.wiseman@cantab.net>
Source: https://www.cantab.net/users/john.wiseman/Documents/
Files-Excluded: *.vcproj* *.bak *.lib *.dll *.wav *.asm *.vcxproj* *.pdb *.exe
.gitignore XAprs zlib.h zconf.h MQTT* pcap.h miniupnpc.h upnpdev.h
igd_desc_parse.h upnpcommands.h upnperrors.h miniupnpctypes.h
*.svn-base *.db *.obj
Files: *
Copyright: 1990-2025 John Wiseman G8BPQ <john.wiseman@cantab.net>
License: GPL-3
Files: debian/*
Copyright: 2016-2025 Dave Hibberd <d@vehibberd.com>
License: GPL-3
Files: debian/linbpq.service
Copyright: 2024-2025 Tom Fanning M0LTE
License: GPL-3
License: GPL-3
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
The GPL License which applies to this package can be found on your Debian
system at /usr/share/common-licenses/GPL-3.

2
debian/dirs vendored Normal file
View File

@ -0,0 +1,2 @@
usr/sbin
opt/oarc/bpq

3
debian/gbp.conf vendored Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
debian-branch = hibbian/latest
upstream-branch = upstream/latest

6
debian/gitlab-ci.yml vendored Normal file
View File

@ -0,0 +1,6 @@
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
reprotest:
extends: .test-reprotest-diffoscope

1
debian/install vendored Normal file
View File

@ -0,0 +1 @@
debian/bpq32.cfg etc/

1
debian/linbpq.examples vendored Normal file
View File

@ -0,0 +1 @@
debian/bpq32.cfg

14
debian/linbpq.service vendored Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=Linbpq systemd service file
After=network.target
ConditionPathExists=/etc/bpq32.cfg
[Service]
ExecStart=/usr/sbin/linbpq -c /etc -d /opt/oarc/bpq -l /opt/oarc/bpq
WorkingDirectory=/opt/oarc/bpq
Restart=always
User=linbpq
Group=linbpq
[Install]
WantedBy=multi-user.target

11
debian/lintian-overrides vendored Normal file
View File

@ -0,0 +1,11 @@
# weirdness from oarc packaging
linbpq: dir-or-file-in-opt [opt/oarc/]
linbpq: dir-or-file-in-opt [opt/oarc/bpq/]
# i know!
linbpq: no-manual-page [usr/sbin/linbpq]
# Directory is populated on first run
linbpq: package-contains-empty-directory [opt/oarc/bpq/]
# Code convenience
linbpq: spelling-error-in-binary Dont Don't [usr/sbin/linbpq]
linbpq: spelling-error-in-binary Paramters Parameters [usr/sbin/linbpq]
linbpq: spelling-error-in-binary lon long [usr/sbin/linbpq]

47
debian/patches/makefile vendored Normal file
View File

@ -0,0 +1,47 @@
--- a/makefile
+++ b/makefile
@@ -2,8 +2,7 @@
# To exclude i2c support run make noi2c
-OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pngwutil.o\
- pngread.o pngwrite.o png.o pngerror.o pngget.o pngmem.o APRSIconData.o AISCommon.o\
+OBJS = APRSIconData.o AISCommon.o\
upnp.o APRSStdPages.o HSMODEM.o WinRPR.o KISSHF.o TNCEmulators.o bpqhdlc.o SerialPort.o\
adif.o WebMail.o utf8Routines.o VARA.o LzFind.o Alloc.o LzmaDec.o LzmaEnc.o LzmaLib.o \
Multicast.o ARDOP.o IPCode.o FLDigi.o linether.o CMSAuth.o APRSCode.o BPQtoAGW.o KAMPactor.o\
@@ -17,12 +16,12 @@
# Configuration:
-#Default to Linux
- CC = gcc
- LDFLAGS = -Xlinker -Map=output.map -lrt
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+CFLAGS+=$(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
-all: CFLAGS = -DLINBPQ -MMD -g -fcommon -fasynchronous-unwind-tables $(EXTRA_CFLAGS)
-all: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lm -lz -lpthread -lconfig -lpcap
+all: CFLAGS += -DLINBPQ -MMD -g -rdynamic -fcommon -fasynchronous-unwind-tables
+all: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lrt -lm -lz -lpthread -lconfig -lpcap -lpng
all: linbpq
#other OS
@@ -74,12 +73,11 @@
linbpq: $(OBJS)
- cc $(OBJS) $(CFLAGS) $(LDFLAGS) $(LIBS) -o linbpq
- sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
+ $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(LIBS) -o linbpq
-include *.d
-clean :
- rm *.d
- rm linbpq $(OBJS)
+install:
+ install -b -m 755 -D -d debian/linbpq/usr/sbin
+ install -b -m 755 -p linbpq debian/linbpq/usr/sbin

2
debian/patches/series vendored Normal file
View File

@ -0,0 +1,2 @@
spelling-fixes.patch
makefile

11
debian/patches/spelling-fixes.patch vendored Normal file
View File

@ -0,0 +1,11 @@
--- a/UZ7HODrv.c
+++ b/UZ7HODrv.c
@@ -382,7 +382,7 @@
if (AGW->CenterFreq == 0)
{
- buffptr->Len = sprintf((UCHAR *)&buffptr->Data[0], "UZ7HO} Invalid Modem Freqency\r");
+ buffptr->Len = sprintf((UCHAR *)&buffptr->Data[0], "UZ7HO} Invalid Modem Frequency\r");
return 1;
}

47
debian/postinst vendored Normal file
View File

@ -0,0 +1,47 @@
#!/bin/sh
set -e
if [ "$1" = configure ]; then
# if ! getent group linbpq >/dev/null; then
# addgroup --system --force-badname linbpq || true
# fi
echo "Creating/updating linbpq user account..."
adduser --system --group --home /opt/oarc/bpq \
--gecos "linbpq system user" --shell /bin/false \
--quiet --disabled-password linbpq || {
# adduser failed. Why?
if getent passwd linbpq >/dev/null ; then
echo "Non-system user linbpq found. I will not overwrite a non-system" >&2
echo "user. Remove the user and reinstall linbpq." >&2
exit 1
fi
# unknown adduser error, simply exit
exit 1
}
if ! id -nGz linbpq | grep -qzxF 'dialout' ; then
adduser linbpq dialout
fi
if ! id -nGz linbpq | grep -qzxF 'plugdev' ; then
adduser linbpq plugdev
fi
chown :linbpq /opt/oarc/bpq
chmod 775 /opt/oarc/bpq
# If we have setcap is installed, set the requirements
# which allows us to install our binaries without the setuid
# bit.
if command -v setcap > /dev/null; then
setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" /usr/sbin/linbpq
else
echo "Setcap failed on /usr/sbin/linbpq, Features may be limited" >&2
fi
else
echo "Setcap is not installed, Features may be limited" >&2
fi
#DEBHELPER#

14
debian/preinst vendored Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
set -e
confile="/etc/bpq32.cfg"
node="/opt/oarc/bpq/bpq32.cfg"
if [ -L $confile ]; then
rm $confile
cp $node $confile
mv $node $node.bak
fi
#DEBHELPER#

6
debian/rules vendored Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
%:
dh $@

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

0
debian/source/include-binaries vendored Normal file
View File

0
debian/source/lintian-overrides vendored Normal file
View File

3
debian/watch vendored Normal file
View File

@ -0,0 +1,3 @@
version=4
opts="pgpmode=none,dversionmangle=s/\+repack//,repacksuffix=+repack,repack,compression=xz" \
http://127.0.0.1:8000/linbpq-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))

View File

@ -22,17 +22,29 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Normally uses a Raw socket, but that can't send to other apps on same machine.
// so can use a TAP device instead (or maybe as well??)
// Not suported on BSD based systems
#ifndef FREEBSD
#ifndef MACBPQ
#if !(defined(MACBPQ) || defined(FREEBSD))
#include <stdio.h>
#include "cheaders.h"
#include <sys/socket.h>
#if !(defined(FREEBSD))
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/if_arp.h>
#endif
#endif
extern int tap_fd;
typedef struct PCAPStruct
@ -489,5 +501,11 @@ static int ProcessLine(char * buf, int Port, BOOL CheckPort)
return (FALSE);
}
//
#endif // MACBPQ
#endif // FREEBSD
#endif

View File

@ -1406,7 +1406,7 @@ File: 5566 NEWBOAT.HOMEPORT.JPG
if (SendBBStoSYSOPCall)
if (_stricmp(FullTo, BBSName) == 0)
strcpy(Msg->to, SYSOPCall);
strcpy(FullTo, SYSOPCall);
if ((Msg->via[0] == 0 || strcmp(Msg->via, "BPQ") == 0 || strcmp(Msg->via, "BBS") == 0)
&& (conn->Paclink || conn->RMSExpress))

View File

@ -17,22 +17,64 @@ OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pn
# Configuration:
CC = gcc
all: CFLAGS = -DLINBPQ -MMD -g -rdynamic -fcommon -fasynchronous-unwind-tables
all: LDFLAGS = -l:libpaho-mqtt3a.a -l:libjansson.a
#Default to Linux
CC = gcc
LDFLAGS = -Xlinker -Map=output.map -lrt
all: CFLAGS = -DLINBPQ -MMD -g -fcommon -fasynchronous-unwind-tables $(EXTRA_CFLAGS)
all: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lm -lz -lpthread -lconfig -lpcap
all: linbpq
#other OS
OS_NAME = $(shell uname -s)
ifeq ($(OS_NAME),NetBSD)
CC = cc
EXTRA_CFLAGS = -DFREEBSD -DNOMQTT -I/usr/pkg/include
LDFLAGS = -Xlinker -Map=output.map -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lrt -lutil -lexecinfo
all: CFLAGS = -DLINBPQ -MMD -g -fcommon -fasynchronous-unwind-tables $(EXTRA_CFLAGS)
all: LIBS = -lminiupnpc -lm -lz -lpthread -lconfig -lpcap
all: linbpq
endif
ifeq ($(OS_NAME),FreeBSD)
CC = cc
EXTRA_CFLAGS = -DFREEBSD -DNOMQTT -I/usr/local/include
LDFLAGS = -Xlinker -Map=output.map -L/usr/local/lib -lrt -liconv -lutil -lexecinfo
all: CFLAGS = -DLINBPQ -MMD -g -fcommon -fasynchronous-unwind-tables $(EXTRA_CFLAGS)
all: LIBS = -lminiupnpc -lm -lz -lpthread -lconfig -lpcap
all: linbpq
endif
ifeq ($(OS_NAME),Darwin)
CC = gcc
EXTRA_CFLAGS = -DMACBPQ -DNOMQTT
LDFLAGS = -liconv
all: CFLAGS = -DLINBPQ -MMD -g -fcommon -fasynchronous-unwind-tables $(EXTRA_CFLAGS)
all: LIBS = -lminiupnpc -lm -lz -lpthread -lconfig -lpcap
all: linbpq
endif
$(info OS_NAME is $(OS_NAME))
nomqtt: CFLAGS = -DLINBPQ -MMD -fcommon -g -rdynamic -DNOMQTT -fasynchronous-unwind-tables
nomqtt: LIBS = -lminiupnpc -lm -lz -lpthread -lconfig -lpcap
nomqtt: linbpq
noi2c: CFLAGS = -DLINBPQ -MMD -DNOI2C -g -rdynamic -fcommon -fasynchronous-unwind-tables
noi2c: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lm -lz -lpthread -lconfig -lpcap
noi2c: linbpq
linbpq: $(OBJS)
gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lrt -lm -lz $(LDFLAGS) -lpthread -lconfig -lpcap -o linbpq
cc $(OBJS) $(CFLAGS) $(LDFLAGS) $(LIBS) -o linbpq
sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
-include *.d

14
upnp.c
View File

@ -41,7 +41,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <winsock2.h>
#endif
#ifdef LINBPQ
#ifndef MACBPQ
#ifndef WIN32
#include <miniupnpc/upnpcommands.h>
#include <miniupnpc/miniupnpc.h>
@ -49,13 +48,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
#endif
#endif
#endif
#ifdef MACBPQ
#include </usr/local/Cellar/miniupnpc/2.2.5/include/miniupnpc/upnpcommands.h>
#include </usr/local/Cellar/miniupnpc/2.2.5/include/miniupnpc/miniupnpc.h>
#include </usr/local/Cellar/miniupnpc/2.2.5/include/miniupnpc/upnperrors.h>
#include <stdio.h>
#endif
int AddMap(char * controlURL, char * eport, char * iport, char * proto);
int DeleteMap(char * controlURL, char * eport, char * iport, char * proto);
@ -134,7 +128,7 @@ int upnpInit()
return 0;
}
#if MINIUPNPC_API_VERSION == 18
#if MINIUPNPC_API_VERSION >= 18
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), wanaddr, sizeof(wanaddr));
#else
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
@ -168,7 +162,7 @@ int upnpClose()
return 0;
}
#if MINIUPNPC_API_VERSION == 18
#if MINIUPNPC_API_VERSION >= 18
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), wanaddr, sizeof(wanaddr));
#else
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));