fdt_gen.c File Reference

FDT generation. More...

#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
#include <string.h>
#include <sys/types.h>
#include <windows.h>
#include "../alclib/alc_session.h"
#include "../alclib/fec.h"
#include "../alclib/blocking_alg.h"
#include "fdt_gen.h"
#include "uri.h"
#include "getdnsname.h"
#include "padding_encoding.h"
#include "mad_zlib.h"
#include "mad_md5.h"

Include dependency graph for fdt_gen.c:

Go to the source code of this file.

Functions

int checkpath (const char *path)
int is_enough_source_block_numbers (unsigned int max_sb_len, int es_len, unsigned long long f_size, unsigned char fec_enc_id, unsigned short fec_inst_id)
int encode_file (char *file, char *base_dir, FILE *fp, int *s_id)
int encode_directory (char *directory, char *base_dir, FILE *fp, int *s_id)
int generate_fdt (char *file_token, char *base_dir, int *s_id, char *fdt_file_name, int complete_fdt, int verbosity)

Variables

unsigned long long toi


Detailed Description

FDT generation.

Author
peltotal
Date
2007/02/28 08:58:01
Revision
1.29

MAD-FLUTELIB: Implementation of FLUTE protocol. Copyright (c) 2003-2007 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

In addition, as a special exception, TUT - Tampere University of Technology gives permission to link the code of this program with the OpenSSL library (or with modified versions of OpenSSL that use the same license as OpenSSL), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than OpenSSL. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.

Definition in file fdt_gen.c.


Function Documentation

int checkpath ( const char *  path  ) 

This is a private function which checks if path is empty, . or ..

Parameters:
path pointer to buffer containg path
Returns:
1 if path is empty, . or .., 0 otherwise

Definition at line 67 of file fdt_gen.c.

Referenced by encode_directory().

Here is the caller graph for this function:

int encode_directory ( char *  directory,
char *  base_dir,
FILE *  fp,
int *  s_id 
)

This is a private function which parses directory to the FDT.

Parameters:
directory directory to be parsed
base_dir base directory for file to be parsed to the FDT
fp file pointer to the generated FDT
s_id session identifier
Returns:
0 in success, -1 otherwise

Definition at line 434 of file fdt_gen.c.

References alloc_uri_struct(), alc_session::calculate_session_size, checkpath(), compute_padding_length(), alc_session::def_eslen, alc_session::def_fec_enc_id, alc_session::def_fec_inst_id, alc_session::def_fec_ratio, alc_session::def_max_sblen, alc_session::encode_content, FALSE, file_gzip_compress(), file_md5(), free_uri(), get_alc_session(), getdnsname(), GF_BITS, GZ_SUFFIX, MAX_PATH_LENGTH, PAD_FILES, RS_FEC_ENC_ID, SB_SYS_FEC_ENC_ID, set_uri_host(), set_uri_path(), set_uri_scheme(), set_uri_user(), toi, uri_string(), alc_session::use_fec_oti_ext_hdr, and ZLIB_FDT_AND_GZIP_FILES.

Referenced by generate_fdt().

Here is the call graph for this function:

Here is the caller graph for this function:

int encode_file ( char *  file,
char *  base_dir,
FILE *  fp,
int *  s_id 
)

This is a private function which parses file to the FDT.

Parameters:
file file to be parsed
base_dir base directory for file to be parsed to the FDT
fp file pointer to the generated FDT
s_id session identifier
Returns:
0 in success, -1 otherwise

Definition at line 138 of file fdt_gen.c.

References alloc_uri_struct(), alc_session::calculate_session_size, compute_padding_length(), alc_session::def_eslen, alc_session::def_fec_enc_id, alc_session::def_fec_inst_id, alc_session::def_fec_ratio, alc_session::def_max_sblen, alc_session::encode_content, FALSE, file_gzip_compress(), file_md5(), free_uri(), get_alc_session(), getdnsname(), GF_BITS, GZ_SUFFIX, is_enough_source_block_numbers(), MAX_PATH_LENGTH, PAD_FILES, RS_FEC_ENC_ID, SB_SYS_FEC_ENC_ID, set_uri_host(), set_uri_path(), set_uri_scheme(), set_uri_user(), toi, uri_string(), alc_session::use_fec_oti_ext_hdr, ZLIB_FDT, and ZLIB_FDT_AND_GZIP_FILES.

Referenced by generate_fdt().

Here is the call graph for this function:

Here is the caller graph for this function:

int generate_fdt ( char *  file_token,
char *  base_dir,
int *  s_id,
char *  fdt_file_name,
int  complete_fdt,
int  verbosity 
)

This function generates an FDT file.

Parameters:
file_token files or directories to be parsed to the FDT
base_dir base directory for files or directories to be parsed to the FDT
s_id session identifier
fdt_file_name file name for the generated FDT
complete_fdt generate complete FDT (0 = no, 1 and 2 = yes)
verbosity verbosity level
Returns:
0 in success, -1 otherwise

Definition at line 1154 of file fdt_gen.c.

References encode_directory(), encode_file(), get_alc_session(), GF_BITS, MAX_PATH_LENGTH, RS_FEC_ENC_ID, SB_SYS_FEC_ENC_ID, and toi.

Referenced by flute_sender().

Here is the call graph for this function:

Here is the caller graph for this function:

int is_enough_source_block_numbers ( unsigned int  max_sb_len,
int  es_len,
unsigned long long  f_size,
unsigned char  fec_enc_id,
unsigned short  fec_inst_id 
)

This is a private function which checks is there enough source block numbers available.

Parameters:
max_sb_len maximum source block length
es_len encoding symbol length
f_size the size of the file
fec_enc_id FEC encoding id
fec_inst_id FEC instance id
Returns:
0 in success, -1 otherwise

Definition at line 96 of file fdt_gen.c.

References COM_FEC_ENC_ID, COM_NO_C_FEC_ENC_ID, compute_blocking_structure(), blocking_struct::N, REED_SOL_FEC_INST_ID, RS_FEC_ENC_ID, SB_LB_E_FEC_ENC_ID, SB_SYS_FEC_ENC_ID, and SIMPLE_XOR_FEC_ENC_ID.

Referenced by encode_file().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

unsigned long long toi

transport object identifier used in parsing

Definition at line 56 of file fdt_gen.c.

Referenced by analyze_packet(), encode_directory(), encode_file(), and generate_fdt().


Generated on Fri Mar 9 20:02:16 2007 for MAD-FCL by  doxygen 1.5.0