2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* Name: igate.h
|
|
|
|
*
|
|
|
|
* Purpose: Interface to the Internet Gateway functions.
|
|
|
|
*
|
|
|
|
*-----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef IGATE_H
|
|
|
|
#define IGATE_H 1
|
|
|
|
|
|
|
|
|
|
|
|
#include "ax25_pad.h"
|
|
|
|
#include "digipeater.h"
|
2015-07-27 01:17:23 +00:00
|
|
|
#include "audio.h"
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
#define DEFAULT_IGATE_PORT 14580
|
|
|
|
|
|
|
|
|
2016-01-30 15:36:15 +00:00
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
struct igate_config_s {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For logging into the IGate server.
|
|
|
|
*/
|
|
|
|
char t2_server_name[40]; /* Tier 2 IGate server name. */
|
|
|
|
|
|
|
|
int t2_server_port; /* Typically 14580. */
|
|
|
|
|
|
|
|
char t2_login[AX25_MAX_ADDR_LEN];/* e.g. WA9XYZ-15 */
|
|
|
|
/* Note that the ssid could be any two alphanumeric */
|
|
|
|
/* characters not just 1 thru 15. */
|
|
|
|
/* Could be same or different than the radio call(s). */
|
|
|
|
/* Not sure what the consequences would be. */
|
|
|
|
|
|
|
|
char t2_passcode[8]; /* Max. 5 digits. Could be "-1". */
|
|
|
|
|
|
|
|
char *t2_filter; /* Optional filter for IS -> RF direction. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For transmitting.
|
|
|
|
*/
|
|
|
|
int tx_chan; /* Radio channel for transmitting. */
|
|
|
|
/* 0=first, etc. -1 for none. */
|
2017-01-01 16:49:55 +00:00
|
|
|
/* Presently IGate can transmit on only a single channel. */
|
|
|
|
/* A future version might generalize this. */
|
|
|
|
/* Each transmit channel would have its own client side filtering. */
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
char tx_via[80]; /* VIA path for transmitting third party packets. */
|
|
|
|
/* Usual text representation. */
|
|
|
|
/* Must start with "," if not empty so it can */
|
|
|
|
/* simply be inserted after the destination address. */
|
|
|
|
|
2016-07-03 22:09:34 +00:00
|
|
|
int max_digi_hops; /* Maximum number of digipeater hops possible for via path. */
|
2017-01-01 16:49:55 +00:00
|
|
|
/* Derived from the SSID when last character of address is a digit. */
|
|
|
|
/* e.g. "WIDE1-1,WIDE5-2" would be 3. */
|
2016-07-03 22:09:34 +00:00
|
|
|
/* This is useful to know so we can determine how many */
|
|
|
|
/* stations we might be able to reach. */
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
int tx_limit_1; /* Max. packets to transmit in 1 minute. */
|
|
|
|
|
|
|
|
int tx_limit_5; /* Max. packets to transmit in 5 minutes. */
|
2017-01-01 16:49:55 +00:00
|
|
|
|
|
|
|
int igmsp; /* Number of message sender position reports to allow. */
|
|
|
|
/* Common practice is to default to 1. */
|
|
|
|
/* We allow additional flexibility of 0 to disable feature */
|
|
|
|
/* or a small number to allow more. */
|
|
|
|
|
2016-01-30 15:36:15 +00:00
|
|
|
/*
|
|
|
|
* Special SATgate mode to delay packets heard directly.
|
|
|
|
*/
|
|
|
|
int satgate_delay; /* seconds. 0 to disable. */
|
2015-07-27 00:35:07 +00:00
|
|
|
};
|
|
|
|
|
2015-11-18 13:09:45 +00:00
|
|
|
|
|
|
|
#define IGATE_TX_LIMIT_1_DEFAULT 6
|
|
|
|
#define IGATE_TX_LIMIT_1_MAX 20
|
|
|
|
|
|
|
|
#define IGATE_TX_LIMIT_5_DEFAULT 20
|
|
|
|
#define IGATE_TX_LIMIT_5_MAX 80
|
|
|
|
|
2016-01-30 15:36:15 +00:00
|
|
|
#define DEFAULT_SATGATE_DELAY 10
|
|
|
|
#define MIN_SATGATE_DELAY 5
|
|
|
|
#define MAX_SATGATE_DELAY 30
|
|
|
|
|
2015-11-18 13:09:45 +00:00
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
/* Call this once at startup */
|
|
|
|
|
2015-11-18 13:09:45 +00:00
|
|
|
void igate_init (struct audio_s *p_audio_config, struct igate_config_s *p_igate_config, struct digi_config_s *p_digi_config, int debug_level);
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
/* Call this with each packet received from the radio. */
|
|
|
|
|
|
|
|
void igate_send_rec_packet (int chan, packet_t recv_pp);
|
|
|
|
|
2015-11-18 13:09:45 +00:00
|
|
|
/* This when digipeater transmits. Set bydigi to 1 . */
|
|
|
|
|
|
|
|
void ig_to_tx_remember (packet_t pp, int chan, int bydigi);
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2016-07-03 22:09:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Get statistics for IGATE status beacon. */
|
|
|
|
|
|
|
|
int igate_get_msg_cnt (void);
|
|
|
|
|
|
|
|
int igate_get_pkt_cnt (void);
|
|
|
|
|
|
|
|
int igate_get_upl_cnt (void);
|
|
|
|
|
|
|
|
int igate_get_dnl_cnt (void);
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
#endif
|