📄 mad.h
字号:
/* $Author: peltotas $ $Date: 2006/03/16 13:45:54 $ $Revision: 1.18 $ *//* * MAD-ALCLIB: Implementation of ALC/LCT protocols, Compact No-Code FEC, * Simple XOR FEC, Reed-Solomon FEC, and RLC Congestion Control protocol. * Copyright (c) 2003-2006 TUT - Tampere University of Technology * main authors/contacts: jani.peltotalo@tut.fi and sami.peltotalo@tut.fi * * 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 2 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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */#ifndef _MAD_H_#define _MAD_H_#include "inc.h"/**** Macros for min and max if not defined in Operation System ****/#ifndef min #define min(a,b) ((a) <= (b) ? (a) : (b))#endif#ifndef max #define max(a,b) ((a) >= (b) ? (a) : (b))#endif/**** Define bool, true and false if not defined in Operation System ****/#ifndef bool #define bool int#endif#ifndef true #define true 1#endif#ifndef false #define false 0#endif/**** Global variables ****/extern bool lib_init;/**** Functions ****/void alc_init(void);double sec(void);int ushort_ipv6addr(char *ipv6, unsigned short *ipv6addr, int *nb_ipv6_part);int randomloss(double lossprob);#ifdef WIN32typedef struct { LONGLONG quot; LONGLONG rem;}lldiv_t;#endif#ifdef WIN32lldiv_t lldiv(LONGLONG num, LONGLONG denom);#endif/**** Typedefs *****/typedef struct alc_arguments { #ifdef WIN32 ULONGLONG tsi; /* Transport Session Identifier */ ULONGLONG start_time; /* Session start time */ ULONGLONG stop_time; /* Session stop time */#else unsigned long long tsi; /* Transport Session Identifier */ unsigned long long start_time; /* Session start time */ unsigned long long stop_time; /* Session stop time */#endif char *port; /* Base channel port number */ char *addr; /* Base channel Mcast address */ char *intface; /* Local interface to bind */ char *intface_name; /* Name/index of local interface for IPv6 multicast join */ unsigned int addr_family; /* Address family */ unsigned char addr_type; /* multicast or unicast */ unsigned char mode; /* Sender or receiver? */ unsigned char nb_channel; /* Number of channels */ unsigned char cc_id; /* Congestion control */ unsigned char rx_memory_mode; /* Receivers rx_memory_mod */ int verbosity; /* Verbosity level */ char *src_addr; /* Source address for filtering traffic */ char base_dir[MAX_LENGTH]; /* Base directory for downloaded files */ bool accept_expired_fdt_inst; #ifdef SSM bool use_ssm; /* Use Source Specific Multicast */#endif unsigned int tx_rate; /* Transmission rate in kbit/s */ unsigned char ttl; /* Time to Live */ unsigned short nb_tx; /* How many times to send the file/directory? */ bool simul_losses; /* Simulate packet losses */ double loss_ratio1; /* Packet loss ratio 1 */ double loss_ratio2; /* Packet loss ratio 2 */ unsigned short fec_ratio; /* FEC ratio percent */ unsigned short es_len; /* Encoding symbol length */ unsigned int max_sb_len; /* Maximum Source block length */ unsigned char fec_enc_id; /* FEC Encoding ID*/ unsigned short fec_inst_id; /* FEC Instance ID*/ bool use_fec_oti_ext_hdr; /* Include FEC OTI extension header to FLUTE header */ unsigned char encode_content; /* Encode content using zlib library 0 = no, 1 = FDT, 2 = FDT and files */ bool half_word; bool optimize_tx_rate; /* if true, optimize transmission rate (use more CPU) */ bool calculate_session_size;} alc_arguments_t;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -