⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transport.h

📁 这个程序实现了FLUTE协议
💻 H
字号:
/* $Author: peltotal $ $Date: 2006/02/17 09:14:37 $ $Revision: 1.21 $ *//* *   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 _TRANSPORT_H_#define _TRANSPORT_H_/**** Typedefs ****/ typedef struct trans_unit {	struct trans_unit	*prev;		/* pointer to previous unit */	struct trans_unit	*next;		/* pointer to next unit */	unsigned int		esi;		/* encoding symbol ID */	unsigned short		len;		/* length of this TU (in bytes) */	char				*data;		/* pointer to data buffer */#ifdef WIN32	ULONGLONG			offset;		/* data symbol offset in the tmp file */#else	unsigned long long	offset;#endif} trans_unit_t;typedef struct trans_block {  /*struct trans_block	*prev;*/				/* pointer to previous block */  /*struct trans_block	*next;*/				/* pointer to next block */	unsigned int		sbn;				/* source block number */	struct trans_unit	*unit_list;			/* pointer to first unit for this block */	unsigned int		nb_of_rx_units;		/* received units for this block */	unsigned int		n;					/* number of units for this block */	unsigned int		k;	unsigned int		max_k;	unsigned int		max_n;} trans_block_t;typedef struct trans_obj {	struct trans_obj	*prev;					/* pointer to previous obj */	struct trans_obj	*next;					/* pointer to next obj */        trans_block_t           *block_list;  /*struct trans_block	*block_list_start;*/  /* pointer to first block for this object */  /*struct trans_block      *block_list_end;*/  /* pointer to last block for this object */	unsigned int		nb_of_ready_blocks;		/* number of ready blocks for this object */	unsigned char 		fec_enc_id;				/* identifier that maps to the FEC scheme */	unsigned short 		fec_inst_id;			/* identifier that maps to the FEC algorithm */	unsigned char		content_enc_algo;			/* content encoding algorithm */#ifdef WIN32	ULONGLONG		len;			/* length of this TO (in bytes) */				ULONGLONG		rx_bytes;		/* received bytes for this TO */	ULONGLONG		toi;			/* transport object identifier */#else	unsigned long long	len;				unsigned long long	rx_bytes;	unsigned long long	toi;#endif	unsigned int		es_len;			/* Encoding symbol length */	unsigned int		max_sb_len;		/* Maximum size source block length */	struct blocking_struct  *bs;	char			*tmp_filename;		/* temporary filename for this object */	int			fd;			/* file descriptor to be used for file saving */        char                    *tmp_st_filename;          /* temporary filename for the symbol store */        int                     fd_st;                  /* file descriptor for the symbol store */	double			last_print_rx_percent;} trans_obj_t;/**** Functions ****/trans_obj_t* create_object(void);trans_block_t* create_block(void);trans_unit_t* create_units(unsigned int number);void free_units(trans_block_t *tb);void insert_object(trans_obj_t *to, alc_session_t *s, int type);void insert_block(trans_block_t *tb, trans_obj_t *to);int insert_unit(trans_unit_t *tu, trans_block_t *tb, trans_obj_t *to);void free_object(trans_obj_t *to, alc_session_t *s, int type);#endif /* _TRANSPORT_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -