wanpipe-7.0.6.tgz

This commit is contained in:
Harald Welte 2021-12-29 18:59:05 +01:00
parent fbbdc67f33
commit 1da67d9379
40 changed files with 283 additions and 46 deletions

View File

@ -1,2 +1,2 @@
wanpipe_linux: git ver b2503d8 wanpipe_linux: git ver 23ab060
wanpipe_common: git ver 9b182f2 wanpipe_common: git ver c71136f

View File

@ -1 +1 @@
wanpipe-7.0.5 wanpipe-7.0.6

View File

@ -8,6 +8,15 @@ Copyright (c) 1995-2013 Sangoma Technologies Inc.
For more info visit: http://wiki.sangoma.com For more info visit: http://wiki.sangoma.com
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
* Wed Sep 25 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.6
==================================================================
- Updated wanpipemon to trace on multipel dchan in a single span
eg: wanpipemon -i w1g1 -chan 1 -c trd
If chan is not specificed then all dchans will be traced together.
- Updated sample tapping application.
Allow configuration for dchan and seven bit hdlc
* Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5 * Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5
================================================================== ==================================================================

2
Setup
View File

@ -7338,7 +7338,7 @@ KERNEL_UNAME=`uname -r`
PKG_NAME=wanpipe PKG_NAME=wanpipe
DISTR_NAME="WANPIPE" DISTR_NAME="WANPIPE"
PROD=wanrouter PROD=wanrouter
PROD_VER=7.0.5 PROD_VER=7.0.6
PROD_HOME=`pwd` PROD_HOME=`pwd`
META_CONF=$PROD_HOME/$PROD.rc META_CONF=$PROD_HOME/$PROD.rc
WAN_INTR_DIR=$PROD_HOME/interfaces WAN_INTR_DIR=$PROD_HOME/interfaces

View File

@ -39,7 +39,9 @@
/* Enable/Disable tx of random frames */ /* Enable/Disable tx of random frames */
#define RAND_FRAME 0 #define RAND_FRAME 0
#define MAX_NUM_OF_TIMESLOTS 32*32 #define MAX_SPANS 80
#define MAX_CHANS 32
#define MAX_NUM_OF_TIMESLOTS MAX_SPANS*MAX_CHANS
#define LGTH_CRC_BYTES 2 #define LGTH_CRC_BYTES 2
#define MAX_TX_DATA 15000 //MAX_NUM_OF_TIMESLOTS*10 /* Size of tx data */ #define MAX_TX_DATA 15000 //MAX_NUM_OF_TIMESLOTS*10 /* Size of tx data */
@ -859,7 +861,7 @@ int main (int argc, char* argv[])
pthread_mutex_init(&g_lock, NULL); pthread_mutex_init(&g_lock, NULL);
if (argc < 2){ if (argc < 2){
printf("Usage: hdlc_test <if name> ...\n"); printf("Usage: hdlc_test s1c1 s2c1 [ -verbose ] [ -timeout 0 ] [ -err_limit 5 ] \n");
exit(0); exit(0);
} }
@ -900,7 +902,7 @@ int main (int argc, char* argv[])
} }
sangoma_span_chan_fromif(argv[x+1],&span,&chan); sangoma_span_chan_fromif(argv[x+1],&span,&chan);
if (span > 0 && span <= 32 && chan > 0 && chan < 32) { if (span > 0 && span <= MAX_SPANS && chan > 0 && chan < MAX_CHANS) {
slot=&tslot_array[scnt++]; slot=&tslot_array[scnt++];
} else { } else {
printf("Error: Invalid interface name %s\n",argv[x+1]); printf("Error: Invalid interface name %s\n",argv[x+1]);

View File

@ -492,6 +492,26 @@ int SangomaPort::SetPortConfiguration(const Configuration & config)
buffer_settings.buffer_multiplier_factor = ReceiveBufferSettings.BufferMultiplierFactor; buffer_settings.buffer_multiplier_factor = ReceiveBufferSettings.BufferMultiplierFactor;
buffer_settings.number_of_buffers_per_api_interface = ReceiveBufferSettings.NumberOfBuffersPerPort; buffer_settings.number_of_buffers_per_api_interface = ReceiveBufferSettings.NumberOfBuffersPerPort;
p_drv_cfg_obj->set_dchan(config.dchan,config.dchan_seven_bit,config.dchan_mtp1_filter);
p_drv_cfg_obj->set_chunk_ms(config.chunk_ms);
p_drv_cfg_obj->set_span_api_mode();
switch (config.api_mode) {
case SNG_SPAN_MODE:
p_drv_cfg_obj->set_span_api_mode();
break;
case SNG_CHAN_MODE:
p_drv_cfg_obj->set_chan_api_mode();
buffer_settings.buffer_multiplier_factor=1;
ReceiveBufferSettings.BufferMultiplierFactor=0;
break;
case SNG_DATA_MODE:
p_drv_cfg_obj->set_data_api_mode();
buffer_settings.buffer_multiplier_factor=1;
ReceiveBufferSettings.BufferMultiplierFactor=0;
break;
}
return_code = p_drv_cfg_obj->set_t1_e1_configuration(&sdla_fe_cfg, &buffer_settings); return_code = p_drv_cfg_obj->set_t1_e1_configuration(&sdla_fe_cfg, &buffer_settings);
delete p_drv_cfg_obj; delete p_drv_cfg_obj;
@ -567,7 +587,8 @@ bool SangomaPort::Open(const Configuration & config)
return false; return false;
} }
if(pSangomaInterface->set_buffer_multiplier(wp_api, ReceiveBufferSettings.BufferMultiplierFactor)){ if(ReceiveBufferSettings.BufferMultiplierFactor &&
pSangomaInterface->set_buffer_multiplier(wp_api, ReceiveBufferSettings.BufferMultiplierFactor)){
PORT_FUNC(); PORT_FUNC();
std::ostringstream error_msg; std::ostringstream error_msg;

View File

@ -139,6 +139,12 @@ enum MAX_CABLE_LOSS{
MCLV_12_0dB=120 MCLV_12_0dB=120
}; };
typedef enum SNG_API_MODE{
SNG_SPAN_MODE=0,
SNG_CHAN_MODE=1,
SNG_DATA_MODE=2
} sng_api_mode_t;
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/// \struct Configuration /// \struct Configuration
/// \brief Structure containing all settings necessary to configure a Sangoma port /// \brief Structure containing all settings necessary to configure a Sangoma port
@ -151,6 +157,11 @@ struct Configuration {
MAX_CABLE_LOSS MaxCableLoss; ///< If High Impedance is true, indicates value of external resistor. MAX_CABLE_LOSS MaxCableLoss; ///< If High Impedance is true, indicates value of external resistor.
bool TxTristateMode; ///< If true, indicates transmitter is disabled on T1/E1 level. bool TxTristateMode; ///< If true, indicates transmitter is disabled on T1/E1 level.
bool Master; ///< If true, configure for master clock bool Master; ///< If true, configure for master clock
int dchan; ///< Integer value of a dchan
int chunk_ms; ///< Integer value of ms chunk size default 20 (160bytes per timeslot)
sng_api_mode_t api_mode;
int dchan_seven_bit;
int dchan_mtp1_filter;
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/// \fn Configuration::Configuration() /// \fn Configuration::Configuration()
@ -164,7 +175,8 @@ struct Configuration {
LineCoding(OFF), LineCoding(OFF),
HighImpedanceMode(true), HighImpedanceMode(true),
TxTristateMode(false), TxTristateMode(false),
Master(false) Master(false),
dchan(0)
{} {}
}; };

View File

@ -130,6 +130,9 @@ int driver_configurator::set_configuration(port_cfg_t *port_cfg)
int driver_configurator::init(unsigned int wanpipe_number, unsigned int port_number) int driver_configurator::init(unsigned int wanpipe_number, unsigned int port_number)
{ {
DBG_CFG("%s():\n", __FUNCTION__); DBG_CFG("%s():\n", __FUNCTION__);
memset(&port_cfg, 0x00, sizeof(port_cfg_t));
port_cfg.num_of_ifs = 1;//1 Group always
//this the MAPPED port number //this the MAPPED port number
wp_number = wanpipe_number + port_number + 1; wp_number = wanpipe_number + port_number + 1;
@ -341,6 +344,66 @@ int driver_configurator::scan_for_sangoma_cards(wanpipe_instance_info_t *wanpipe
return card_counter; return card_counter;
} }
int driver_configurator::set_dchan(int dchan, int seven_bit, int mtp1_filter)
{
wandev_conf_t *wandev_conf = &port_cfg.wandev_conf;
wanif_conf_t *wanif_cfg = &port_cfg.if_cfg[0];
if(!dchan) {
return -1;
}
if (seven_bit) {
wanif_cfg->u.aft.sw_hdlc=1;
wanif_cfg->u.aft.seven_bit_hdlc=1;
}
if (mtp1_filter) {
wanif_cfg->u.aft.sw_hdlc=1;
wanif_cfg->u.aft.mtp1_filter=1;
wanif_cfg->u.aft.hdlc_repeat=1;
}
dchan--;
wandev_conf->tdmv_conf.dchan=(1<<dchan);
return 0;
}
int driver_configurator::set_chunk_ms(int chunk_ms)
{
wanif_conf_t *wanif_cfg = &port_cfg.if_cfg[0];
wanif_cfg->u.aft.mru = chunk_ms*8;
wanif_cfg->u.aft.mtu = chunk_ms*8;
return 0;
}
int driver_configurator::set_data_api_mode(void)
{
wandev_conf_t *wandev_conf = &port_cfg.wandev_conf;
wanif_conf_t *wanif_cfg = &port_cfg.if_cfg[0];
sprintf(wanif_cfg->usedby, "DATA_API");
if (wandev_conf->tdmv_conf.dchan) {
wanif_cfg->hdlc_streaming=1;
wanif_cfg->active_ch=wandev_conf->tdmv_conf.dchan;
}
return 0;
}
int driver_configurator::set_chan_api_mode(void)
{
wanif_conf_t *wanif_cfg = &port_cfg.if_cfg[0];
sprintf(wanif_cfg->usedby, SDLA_DECODE_USEDBY_FIELD(TDM_CHAN_VOICE_API));
return 0;
}
int driver_configurator::set_span_api_mode(void)
{
wanif_conf_t *wanif_cfg = &port_cfg.if_cfg[0];
sprintf(wanif_cfg->usedby, SDLA_DECODE_USEDBY_FIELD(TDM_SPAN_VOICE_API));
return 0;
}
//function to switch between T1 and E1 //function to switch between T1 and E1
int driver_configurator::set_t1_e1_configuration(sdla_fe_cfg_t *in_sdla_fe_cfg, buffer_settings_t *buffer_settings) int driver_configurator::set_t1_e1_configuration(sdla_fe_cfg_t *in_sdla_fe_cfg, buffer_settings_t *buffer_settings)
{ {
@ -352,8 +415,6 @@ int driver_configurator::set_t1_e1_configuration(sdla_fe_cfg_t *in_sdla_fe_cfg,
DBG_CFG("%s()\n", __FUNCTION__); DBG_CFG("%s()\n", __FUNCTION__);
memset(&port_cfg, 0x00, sizeof(port_cfg_t));
get_hardware_info(&tmp_hardware_info); get_hardware_info(&tmp_hardware_info);
//copy T1/E1 configuration into the Driver configuration structure. //copy T1/E1 configuration into the Driver configuration structure.
@ -364,8 +425,6 @@ int driver_configurator::set_t1_e1_configuration(sdla_fe_cfg_t *in_sdla_fe_cfg,
wandev_conf->fe_cfg.cfg.te_cfg.active_ch = 0xFFFFFFFF;//a constant wandev_conf->fe_cfg.cfg.te_cfg.active_ch = 0xFFFFFFFF;//a constant
port_cfg.num_of_ifs = 1;//1 Group always
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
wandev_conf->config_id = WANCONFIG_AFT_TE1; wandev_conf->config_id = WANCONFIG_AFT_TE1;
wandev_conf->magic = ROUTER_MAGIC; wandev_conf->magic = ROUTER_MAGIC;
@ -380,10 +439,13 @@ int driver_configurator::set_t1_e1_configuration(sdla_fe_cfg_t *in_sdla_fe_cfg,
wandev_conf->pci_bus_no = tmp_hardware_info.pci_bus_number; wandev_conf->pci_bus_no = tmp_hardware_info.pci_bus_number;
wandev_conf->card_type = WANOPT_AFT; //m_DeviceInfoData.card_model; wandev_conf->card_type = WANOPT_AFT; //m_DeviceInfoData.card_model;
wanif_cfg->hdlc_streaming = WANOPT_NO;//BitStream
wanif_cfg->magic = ROUTER_MAGIC; wanif_cfg->magic = ROUTER_MAGIC;
sprintf(wanif_cfg->usedby, SDLA_DECODE_USEDBY_FIELD(TDM_SPAN_VOICE_API));//TDM_SPAN_VOICE_API - span mode supported by libsangoma.dll. if (wandev_conf->tdmv_conf.dchan && FE_FRAME(sdla_fe_cfg) == WAN_FR_D4) {
wanif_cfg->u.aft.sw_hdlc=1;
wanif_cfg->u.aft.seven_bit_hdlc=1;
}
wanif_cfg->u.aft.idle_flag=0xFF; wanif_cfg->u.aft.idle_flag=0xFF;
sprintf(wanif_cfg->name, "w%dg1", wp_number); sprintf(wanif_cfg->name, "w%dg1", wp_number);
@ -397,24 +459,30 @@ int driver_configurator::set_t1_e1_configuration(sdla_fe_cfg_t *in_sdla_fe_cfg,
//The 'buffer_multiplier_factor' value will control how many of these //The 'buffer_multiplier_factor' value will control how many of these
//buffers will be received on each RX indication. //buffers will be received on each RX indication.
// //
if(FE_MEDIA(sdla_fe_cfg) == WAN_MEDIA_T1){ if (!wanif_cfg->u.aft.mru) {
//320*24=7680 if(FE_MEDIA(sdla_fe_cfg) == WAN_MEDIA_T1){
wanif_cfg->mtu = wanif_cfg->u.aft.mtu = wanif_cfg->u.aft.mru = 320; //320*24=7680
} else { wanif_cfg->mtu = wanif_cfg->u.aft.mtu = wanif_cfg->u.aft.mru = 320;
//240*31=7440, 240*32=7680 } else {
wanif_cfg->mtu = wanif_cfg->u.aft.mtu = wanif_cfg->u.aft.mru = 240; //240*31=7440, 240*32=7680
wanif_cfg->mtu = wanif_cfg->u.aft.mtu = wanif_cfg->u.aft.mru = 240;
}
} }
if(FE_MEDIA(sdla_fe_cfg) == WAN_MEDIA_T1){ if(FE_MEDIA(sdla_fe_cfg) == WAN_MEDIA_T1){
//T1, 1 Group of 24 Timeslots. //T1, 1 Group of 24 Timeslots.
wanif_cfg->active_ch = 0xFFFFFF; if (!wanif_cfg->active_ch) {
wanif_cfg->active_ch = 0xFFFFFF;
}
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW; FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW;
}else if(FE_MEDIA(sdla_fe_cfg) == WAN_MEDIA_E1){ }else if(FE_MEDIA(sdla_fe_cfg) == WAN_MEDIA_E1){
//E1, 1 Group of 31 or 32 Timeslots. //E1, 1 Group of 31 or 32 Timeslots.
//API driver will automatically adjust timeslot bitmap for "framed" e1 //API driver will automatically adjust timeslot bitmap for "framed" e1
wanif_cfg->active_ch = 0xFFFFFFFF; if (!wanif_cfg->active_ch) {
wanif_cfg->active_ch = 0xFFFFFFFF;
}
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_ALAW; FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_ALAW;
FE_LBO(sdla_fe_cfg) = WAN_T1_LBO_NONE;//important to set to a valid value!! FE_LBO(sdla_fe_cfg) = WAN_T1_LBO_NONE;//important to set to a valid value!!

View File

@ -68,6 +68,12 @@ public:
int print_wanif_conf_t_structure(wanif_conf_t *wanif_conf); int print_wanif_conf_t_structure(wanif_conf_t *wanif_conf);
int scan_for_sangoma_cards(wanpipe_instance_info_t *wanpipe_info_array, int card_model); int scan_for_sangoma_cards(wanpipe_instance_info_t *wanpipe_info_array, int card_model);
int set_dchan(int,int,int);
int set_chunk_ms(int);
int set_data_api_mode(void);
int set_span_api_mode(void);
int set_chan_api_mode(void);
private: private:

View File

@ -1,4 +0,0 @@
#!/bin/sh
rm -f *.log
rm -f *.*~

View File

@ -149,6 +149,12 @@ Options:\n\
-t1_esf Disable \"Line Discovery\" and configure for T1_EXTENDED_SUPERFRAME\n\ -t1_esf Disable \"Line Discovery\" and configure for T1_EXTENDED_SUPERFRAME\n\
-t1_sf Disable \"Line Discovery\" and configure for T1_SUPERFRAME\n\ -t1_sf Disable \"Line Discovery\" and configure for T1_SUPERFRAME\n\
-rx2tx If used, all Rx data will be transmitted back to the transmitter.\n\ -rx2tx If used, all Rx data will be transmitted back to the transmitter.\n\
-data_api_mode Enable DATA_API mode, Default SPAN Voice API Mode\n\
-chan_api_mode Enable CHAN_VOICE_API mode, Default SPAN Voice API Mode\n\
-dchan [ 1-31 ] #Default None\n\
-dchan_seven_bit Enable 56K HDLC on D-Chan\n\
-dchan_mtp1_filter Enable SS7 MTP1 Filter on D-Chan\n\
-chunk_ms [ 10 | 20 | 30 | 40 | 50 | 60 ] #Default 20ms (160 bytes per timeslot)\n\
-silent No user interaction.\n\ -silent No user interaction.\n\
-timeout No user interaction.\n\ -timeout No user interaction.\n\
\n\ \n\
@ -156,7 +162,8 @@ Example 1: sample_data_tapping a108 e1\n\
Example 2: sample_data_tapping a108 t1\n\ Example 2: sample_data_tapping a108 t1\n\
Example 3: sample_data_tapping a108 e1 h 320\n\ Example 3: sample_data_tapping a108 e1 h 320\n\
Example 4: sample_data_tapping a108 e1 h 320 tx_tristate\n\ Example 4: sample_data_tapping a108 e1 h 320 tx_tristate\n\
Example 4: sample_data_tapping a108 -e1_cas_crc4 -tx_file c:\\tmp\\test_file.pcm -local_loopback\n" Example 5: sample_data_tapping a108 -e1_cas_crc4 -tx_file c:\\tmp\\test_file.pcm -local_loopback\n\
Example 5: sample_data_tapping a108 -e1_cas_crc4 -dchan 16 -local_loopback\n"
*number_of_ports_per_card = 0; *number_of_ports_per_card = 0;
szTxFileName[0] = '\0'; szTxFileName[0] = '\0';
@ -182,6 +189,20 @@ Example 4: sample_data_tapping a108 -e1_cas_crc4 -tx_file c:\\tmp\\test_file.pcm
}else if(wp_strncasecmp(argv[i], "t116", strlen(argv[i])) == 0){ }else if(wp_strncasecmp(argv[i], "t116", strlen(argv[i])) == 0){
*model = T116; *model = T116;
*number_of_ports_per_card = 16; *number_of_ports_per_card = 16;
}else if(wp_strncasecmp(argv[i], "-dchan", strlen(argv[i])) == 0){
if (i+1 > argc-1){
ERR_MAIN("No Valid 'dchan' value was provided!\n");
printf(USAGE_STR);
return 1;
}
configuration.dchan=atoi(argv[i+1]);
}else if(wp_strncasecmp(argv[i], "-chunk_ms", strlen(argv[i])) == 0){
if (i+1 > argc-1){
ERR_MAIN("No Valid 'chunk_ms' value was provided!\n");
printf(USAGE_STR);
return 1;
}
configuration.chunk_ms=atoi(argv[i+1]);
}else if(wp_strncasecmp(argv[i], "h", strlen(argv[i])) == 0){ }else if(wp_strncasecmp(argv[i], "h", strlen(argv[i])) == 0){
if (i+1 > argc-1){ if (i+1 > argc-1){
ERR_MAIN("No Valid 'Max Cable Loss' value was provided!\n"); ERR_MAIN("No Valid 'Max Cable Loss' value was provided!\n");
@ -276,6 +297,14 @@ Example 4: sample_data_tapping a108 -e1_cas_crc4 -tx_file c:\\tmp\\test_file.pcm
}else if(wp_strncasecmp(argv[i], "-t1_sf", strlen(argv[i])) == 0){ }else if(wp_strncasecmp(argv[i], "-t1_sf", strlen(argv[i])) == 0){
iForcedLineType = T1_SUPERFRAME; iForcedLineType = T1_SUPERFRAME;
configuration.E1OrT1 = T1; configuration.E1OrT1 = T1;
}else if(wp_strncasecmp(argv[i], "-dchan_seven_bit", strlen(argv[i])) == 0){
configuration.dchan_seven_bit = 1;
}else if(wp_strncasecmp(argv[i], "-dchan_mtp1_filter", strlen(argv[i])) == 0){
configuration.dchan_mtp1_filter = 1;
}else if(wp_strncasecmp(argv[i], "-data_api_mode", strlen(argv[i])) == 0){
configuration.api_mode = SNG_DATA_MODE;
}else if(wp_strncasecmp(argv[i], "-chan_api_mode", strlen(argv[i])) == 0){
configuration.api_mode = SNG_CHAN_MODE;
} }
}//for() }//for()
@ -675,6 +704,8 @@ void print_io_stats(void *p_param)
int main_loop_per_port_bank(void *p_param, Configuration & configuration) int main_loop_per_port_bank(void *p_param, Configuration & configuration)
{ {
std::vector<SangomaPort*>* p_ports = static_cast<std::vector<SangomaPort*>*>(p_param); std::vector<SangomaPort*>* p_ports = static_cast<std::vector<SangomaPort*>*>(p_param);
DBG_MAIN("main_loop_per_port_bank\n");
//DETERMINE EACH PORTS CONFIGURATION //DETERMINE EACH PORTS CONFIGURATION
for(unsigned int port_index = 0; port_index < p_ports->size(); ++port_index) for(unsigned int port_index = 0; port_index < p_ports->size(); ++port_index)
@ -730,6 +761,8 @@ int main_loop_per_port_bank(void *p_param, Configuration & configuration)
{ //user specified the Line Type - do not attempt to run Line Discovery. { //user specified the Line Type - do not attempt to run Line Discovery.
if (p_port->GetIsOpen() == false) { if (p_port->GetIsOpen() == false) {
configuration.LineCoding = ON; configuration.LineCoding = ON;
DBG_MAIN("Port Open Foce\n");
p_port->Open(configuration);//open the port with FORCED configuration, only a single time. p_port->Open(configuration);//open the port with FORCED configuration, only a single time.
if (szTxFileName[0] != '\0') { if (szTxFileName[0] != '\0') {
@ -758,8 +791,11 @@ int main_loop_per_port_bank(void *p_param, Configuration & configuration)
configuration.Framing = E1_TYPES[next_frame_type]; configuration.Framing = E1_TYPES[next_frame_type];
configuration.LineCoding = ON; configuration.LineCoding = ON;
} }
DBG_MAIN("Auto Port Close\n");
p_port->Close(); //close the port p_port->Close(); //close the port
DBG_MAIN("Auto Port Open\n");
p_port->Open(configuration); //re-open the port with the new configuration p_port->Open(configuration); //re-open the port with the new configuration
} }
} }
@ -950,6 +986,11 @@ int __cdecl main(int argc, char* argv[])
configuration.MaxCableLoss = MCLV_12_0dB;//default value for both Hi Impedance and Normal mode configuration.MaxCableLoss = MCLV_12_0dB;//default value for both Hi Impedance and Normal mode
configuration.TxTristateMode = false; configuration.TxTristateMode = false;
configuration.Master=0; configuration.Master=0;
configuration.dchan=0; //Disabled
configuration.chunk_ms=0; //To preserver backward compatibility so that MTU is same for T1/E1
configuration.api_mode=SNG_SPAN_MODE;
configuration.dchan_seven_bit=0;
configuration.dchan_mtp1_filter=0;
buffer_settings.BufferMultiplierFactor = BufferSettings::MINIMUM_BUFFER_MULTIPLIER_FACTOR;// go to higher mulitiplier only if CPU usage is high buffer_settings.BufferMultiplierFactor = BufferSettings::MINIMUM_BUFFER_MULTIPLIER_FACTOR;// go to higher mulitiplier only if CPU usage is high

View File

@ -1,5 +1,5 @@
Package: wanpipe Package: wanpipe
Version: 7.0.5-0 Version: 7.0.6-0
Section: networking Section: networking
Priority: optional Priority: optional
Architecture: all Architecture: all

View File

@ -1019,7 +1019,7 @@ extern struct wanpipe_lapb_register_struct lapb_protocol;
int wan_snmp_data(sdla_t* card, netdevice_t* dev, int cmd, struct ifreq* ifr); int wan_snmp_data(sdla_t* card, netdevice_t* dev, int cmd, struct ifreq* ifr);
int wan_capture_trace_packet(sdla_t *card, wan_trace_t* trace_info, netskb_t *skb, char direction); int wan_capture_trace_packet(sdla_t *card, wan_trace_t* trace_info, netskb_t *skb, char direction);
int wan_capture_trace_packet_buffer(sdla_t *card, wan_trace_t* trace_info, char *data, int len, char direction); int wan_capture_trace_packet_buffer(sdla_t *card, wan_trace_t* trace_info, char *data, int len, char direction, int channel);
int wan_capture_trace_packet_offset(sdla_t *card, wan_trace_t* trace_info, netskb_t *skb, int off,char direction); int wan_capture_trace_packet_offset(sdla_t *card, wan_trace_t* trace_info, netskb_t *skb, int off,char direction);
void debug_print_udp_pkt(unsigned char *data,int len,char trc_enabled, char direction); void debug_print_udp_pkt(unsigned char *data,int len,char trc_enabled, char direction);

View File

@ -1060,6 +1060,7 @@ typedef struct {
unsigned char data_avail; unsigned char data_avail;
unsigned short real_length; unsigned short real_length;
unsigned short time_stamp; unsigned short time_stamp;
unsigned char channel;
wan_time_t sec; /* unsigned long sec; */ wan_time_t sec; /* unsigned long sec; */
wan_suseconds_t usec; /* unsigned long usec; */ wan_suseconds_t usec; /* unsigned long usec; */
unsigned char data[0]; unsigned char data[0];

View File

@ -10,14 +10,14 @@
#define WANPIPE_COMPANY "Sangoma Technologies Inc" #define WANPIPE_COMPANY "Sangoma Technologies Inc"
/********** LINUX **********/ /********** LINUX **********/
#define WANPIPE_VERSION "7.0.5" #define WANPIPE_VERSION "7.0.6"
#define WANPIPE_SUB_VERSION "0" #define WANPIPE_SUB_VERSION "0"
#define WANPIPE_LITE_VERSION "1.1.1" #define WANPIPE_LITE_VERSION "1.1.1"
#if defined(__LINUX__) #if defined(__LINUX__)
#define WANPIPE_VERSION_MAJOR 7 #define WANPIPE_VERSION_MAJOR 7
#define WANPIPE_VERSION_MINOR 0 #define WANPIPE_VERSION_MINOR 0
#define WANPIPE_VERSION_MINOR1 5 #define WANPIPE_VERSION_MINOR1 6
#define WANPIPE_VERSION_MINOR2 0 #define WANPIPE_VERSION_MINOR2 0
#endif #endif

View File

@ -901,6 +901,7 @@ int aft_sw_hdlc_trace(void *priv_ptr, u8 *data, int len, int dir)
private_area_t *chan = (private_area_t*)priv_ptr; private_area_t *chan = (private_area_t*)priv_ptr;
private_area_t *top_chan; private_area_t *top_chan;
int err; int err;
int channel=IS_E1_CARD(chan->card) ? chan->first_time_slot : chan->first_time_slot+1;
top_chan=chan; top_chan=chan;
if (chan->channelized_cfg) { if (chan->channelized_cfg) {
@ -908,9 +909,9 @@ int aft_sw_hdlc_trace(void *priv_ptr, u8 *data, int len, int dir)
} }
if (dir) { if (dir) {
err=wan_capture_trace_packet_buffer(chan->card, &top_chan->trace_info, data, len ,TRC_INCOMING_FRM); err=wan_capture_trace_packet_buffer(chan->card, &top_chan->trace_info, data, len ,TRC_INCOMING_FRM, channel);
} else { } else {
err=wan_capture_trace_packet_buffer(chan->card, &top_chan->trace_info, data, len ,TRC_OUTGOING_FRM); err=wan_capture_trace_packet_buffer(chan->card, &top_chan->trace_info, data, len ,TRC_OUTGOING_FRM, channel);
} }
if (err) { if (err) {
WAN_NETIF_STATS_INC_RX_DROPPED(&chan->common); WAN_NETIF_STATS_INC_RX_DROPPED(&chan->common);

View File

@ -1072,15 +1072,18 @@ static int xmtp2km_tap_func(void *prot_ptr, int slot, int dir, unsigned char *da
{ {
private_area_t *chan = (private_area_t*)prot_ptr; private_area_t *chan = (private_area_t*)prot_ptr;
int err; int err;
int channel;
if (!chan) { if (!chan) {
return -1; return -1;
} }
channel=IS_E1_CARD(chan->card) ? chan->first_time_slot : chan->first_time_slot+1;
if (dir) { if (dir) {
err=wan_capture_trace_packet_buffer(chan->card, &chan->trace_info, data, len ,TRC_INCOMING_FRM); err=wan_capture_trace_packet_buffer(chan->card, &chan->trace_info, data, len ,TRC_INCOMING_FRM, channel);
} else { } else {
err=wan_capture_trace_packet_buffer(chan->card, &chan->trace_info, data, len ,TRC_OUTGOING_FRM); err=wan_capture_trace_packet_buffer(chan->card, &chan->trace_info, data, len ,TRC_OUTGOING_FRM, channel);
} }
if (err == -EINVAL) { if (err == -EINVAL) {

View File

@ -984,7 +984,7 @@ int wan_tracing_enabled(wan_trace_t *trace_info)
} }
int wan_capture_trace_packet_buffer(sdla_t *card, wan_trace_t* trace_info, char *data, int len, char direction) int wan_capture_trace_packet_buffer(sdla_t *card, wan_trace_t* trace_info, char *data, int len, char direction, int channel)
{ {
void* new_skb = NULL; void* new_skb = NULL;
wan_trace_pkt_t trc_el; wan_trace_pkt_t trc_el;
@ -1012,6 +1012,7 @@ int wan_capture_trace_packet_buffer(sdla_t *card, wan_trace_t* trace_info, char
trc_el.time_stamp = trc_el.time_stamp =
(unsigned short)((((trc_el.sec * 1000000) + trc_el.usec) / 1000) % 0xFFFF); (unsigned short)((((trc_el.sec * 1000000) + trc_el.usec) / 1000) % 0xFFFF);
trc_el.real_length = len; trc_el.real_length = len;
trc_el.channel=channel;
buf=wan_skb_put(new_skb, sizeof(wan_trace_pkt_t)); buf=wan_skb_put(new_skb, sizeof(wan_trace_pkt_t));
memcpy(buf,(caddr_t)&trc_el,sizeof(wan_trace_pkt_t)); memcpy(buf,(caddr_t)&trc_el,sizeof(wan_trace_pkt_t));

View File

@ -1,6 +1,6 @@
%define WANPIPE_VER wanpipe-modules %define WANPIPE_VER wanpipe-modules
%define name %{WANPIPE_VER} %define name %{WANPIPE_VER}
%define version 7.0.5 %define version 7.0.6
%define release 0 %define release 0
%define serial 1 %define serial 1
%define MODULES_DIR /lib/modules %define MODULES_DIR /lib/modules
@ -59,6 +59,15 @@ fi
%changelog %changelog
* Wed Sep 25 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.6
==================================================================
- Updated wanpipemon to trace on multipel dchan in a single span
eg: wanpipemon -i w1g1 -chan 1 -c trd
If chan is not specificed then all dchans will be traced together.
- Updated sample tapping application.
Allow configuration for dchan and seven bit hdlc
* Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5 * Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5
================================================================== ==================================================================

View File

@ -1,6 +1,6 @@
%define WANPIPE_VER wanpipe-util %define WANPIPE_VER wanpipe-util
%define name %{WANPIPE_VER} %define name %{WANPIPE_VER}
%define version 7.0.5 %define version 7.0.6
%define release 0 %define release 0
%define serial 1 %define serial 1
%define UTILS_DIR /usr/sbin %define UTILS_DIR /usr/sbin
@ -229,6 +229,15 @@ chmod 755 /usr/local/sbin/setup-sangoma
%changelog %changelog
* Wed Sep 25 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.6
==================================================================
- Updated wanpipemon to trace on multipel dchan in a single span
eg: wanpipemon -i w1g1 -chan 1 -c trd
If chan is not specificed then all dchans will be traced together.
- Updated sample tapping application.
Allow configuration for dchan and seven bit hdlc
* Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5 * Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5
================================================================== ==================================================================

View File

@ -1,7 +1,7 @@
%define KERNEL_VERSION %{?kern_ver} %define KERNEL_VERSION %{?kern_ver}
%define WANPIPE_VER wanpipe %define WANPIPE_VER wanpipe
%define name %{WANPIPE_VER} %define name %{WANPIPE_VER}
%define version 7.0.5 %define version 7.0.6
%define release 0 %define release 0
%define serial 1 %define serial 1
%define UTILS_DIR /usr/sbin %define UTILS_DIR /usr/sbin
@ -246,6 +246,15 @@ chmod 755 /usr/local/sbin/setup-sangoma
%changelog %changelog
* Wed Sep 25 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.6
==================================================================
- Updated wanpipemon to trace on multipel dchan in a single span
eg: wanpipemon -i w1g1 -chan 1 -c trd
If chan is not specificed then all dchans will be traced together.
- Updated sample tapping application.
Allow configuration for dchan and seven bit hdlc
* Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5 * Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5
================================================================== ==================================================================

View File

@ -2231,7 +2231,7 @@ init_global_params()
{ {
if [ $OSYSTEM = "Linux" ]; then if [ $OSYSTEM = "Linux" ]; then
ROUTER_VERSION=7.0.5 ROUTER_VERSION=7.0.6
IFCONFIG_LIST=ifconfig IFCONFIG_LIST=ifconfig
MODULE_STAT=lsmod MODULE_STAT=lsmod
WAN_DRIVERS="wanpipe" WAN_DRIVERS="wanpipe"

View File

@ -1,5 +1,11 @@
#!/bin/sh #!/bin/sh
line=${1:t1}
./stats.sh clear ./stats.sh clear
if [ $line = "t1" ]; then
watch -d -n 1 ./stats.sh pmon watch -d -n 1 ./stats.sh pmon
else
watch -d -n 1 ./stats.sh pmon_e1
fi

View File

@ -24,6 +24,9 @@ do
if [ "$1" = "pmon" ]; then if [ "$1" = "pmon" ]; then
token="pmon" token="pmon"
fi fi
if [ "$1" = "pmon_e1" ]; then
token="pmon_e1"
fi
if [ "$1" = "record" ]; then if [ "$1" = "record" ]; then
rec=1 rec=1
fi fi
@ -49,12 +52,35 @@ do
line=`cat t.$$ | grep -e Line | cut -d':' -f2 | awk ' { print $1 }'` line=`cat t.$$ | grep -e Line | cut -d':' -f2 | awk ' { print $1 }'`
bit=`cat t.$$ | grep -e Bit | cut -d':' -f2 | awk ' { print $1 }'` bit=`cat t.$$ | grep -e Bit | cut -d':' -f2 | awk ' { print $1 }'`
out=`cat t.$$ | grep -e Out | cut -d':' -f2 | awk ' { print $1 }'` out=`cat t.$$ | grep -e Out | cut -d':' -f2 | awk ' { print $1 }'`
sync=`cat t.$$ | grep -e Sync | cut -d':' -f2 | awk ' { print $1 }'`
r_over=`ifconfig $dev | grep RX.*overruns | awk '{ print $5 }' | cut -d':' -f2` r_over=`ifconfig $dev | grep RX.*overruns | awk '{ print $5 }' | cut -d':' -f2`
t_over=`ifconfig $dev | grep TX.*overruns | awk '{ print $5 }' | cut -d':' -f2` t_over=`ifconfig $dev | grep TX.*overruns | awk '{ print $5 }' | cut -d':' -f2`
con_status=`ifconfig $dev | grep -c RUNNING` con_status=`ifconfig $dev | grep -c RUNNING`
level=`cat t.$$ | grep "Rx Level" | awk '{print $5}'` level=`cat t.$$ | grep "Rx Level" | cut -d':' -f2 | awk '{print $1}'`
if [ $level = ">" ]; then
level=`cat t.$$ | grep "Rx Level" | cut -d':' -f2 | awk '{print $2}'`
fi
rm t.$$ rm t.$$
echo -e "IF $dev | Pmon: Line=$line Bit=$bit Out=$out Lvl=$level | Overrun: R=$r_over T=$t_over | Status=$con_status" echo -e "IF $dev | Pmon: Line=$line Bit=$bit Out=$out Sync=$sync Lvl=$level | Overrun: R=$r_over T=$t_over | Status=$con_status"
continue
fi
if [ "$token" = "pmon_e1" ]; then
wanpipemon -i $dev -c Ta > t.$$
line=`cat t.$$ | grep -e Line | cut -d':' -f2 | awk ' { print $1 }'`
far=`cat t.$$ | grep -e "Far End" | cut -d':' -f2 | awk ' { print $1 }'`
crc4=`cat t.$$ | grep -e CRC4 | cut -d':' -f2 | awk ' { print $1 }'`
fas=`cat t.$$ | grep -e FAS | cut -d':' -f2 | awk ' { print $1 }'`
sync=`cat t.$$ | grep -e Sync | cut -d':' -f2 | awk ' { print $1 }'`
r_over=`ifconfig $dev | grep RX.*overruns | awk '{ print $5 }' | cut -d':' -f2`
t_over=`ifconfig $dev | grep TX.*overruns | awk '{ print $5 }' | cut -d':' -f2`
con_status=`ifconfig $dev | grep -c RUNNING`
level=`cat t.$$ | grep "Rx Level" | cut -d':' -f2 | awk '{print $1}'`
if [ $level = ">" ]; then
level=`cat t.$$ | grep "Rx Level" | cut -d':' -f2 | awk '{print $2}'`
fi
rm t.$$
echo -e "IF $dev | Pmon: Line=$line Far=$far CRC4=$crc4 FAS=$fas Sync=$sync Lvl=$level | Overrun: R=$r_over T=$t_over | Status=$con_status"
continue continue
fi fi

View File

@ -999,6 +999,8 @@ static void line_trace(int trace_mode)
wan_udp.wan_udphdr_return_code = 0xaa; wan_udp.wan_udphdr_return_code = 0xaa;
wan_udp.wan_udphdr_data_len = 1; wan_udp.wan_udphdr_data_len = 1;
wan_udp.wan_udphdr_data[0]=trace_mode; wan_udp.wan_udphdr_data[0]=trace_mode;
DO_COMMAND(wan_udp); DO_COMMAND(wan_udp);
@ -1101,6 +1103,12 @@ static void line_trace(int trace_mode)
hdlc_trace_iface.usec = trace_iface.usec; hdlc_trace_iface.usec = trace_iface.usec;
curr_pos += sizeof(wan_trace_pkt_t); curr_pos += sizeof(wan_trace_pkt_t);
if (tdmv_chan) {
if (trace_pkt->channel != tdmv_chan) {
continue;
}
}
if (trace_pkt->real_length >= WAN_MAX_DATA_SIZE){ if (trace_pkt->real_length >= WAN_MAX_DATA_SIZE){
printf("\t:the frame data is to big (%u)!", printf("\t:the frame data is to big (%u)!",
@ -2080,7 +2088,7 @@ int AFTMain(char *command,int argc, char* argv[])
break; break;
case 't': case 't':
memset(&trace_iface,0,sizeof(wp_trace_output_iface_t)); memset(&trace_iface,0,sizeof(wp_trace_output_iface_t));
if (!strcmp(opt, "r")){ if (!strcmp(opt, "r")){
raw_data = WAN_TRUE; raw_data = WAN_TRUE;

View File

@ -25,7 +25,7 @@
# #
%define NAME wanpipe %define NAME wanpipe
%define VERSION 7.0.5 %define VERSION 7.0.6
%define RELEASE 0 %define RELEASE 0
%define KVERSION %{?kernel} %define KVERSION %{?kernel}
%define KSRC %{?ksrc} %define KSRC %{?ksrc}
@ -259,6 +259,15 @@ fi
%changelog %changelog
* Wed Sep 25 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.6
==================================================================
- Updated wanpipemon to trace on multipel dchan in a single span
eg: wanpipemon -i w1g1 -chan 1 -c trd
If chan is not specificed then all dchans will be traced together.
- Updated sample tapping application.
Allow configuration for dchan and seven bit hdlc
* Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5 * Mon Jul 15 2013 Nenad Corbic <ncorbic@sangoma.com> - 7.0.5
================================================================== ==================================================================