repair_sender.c File Reference

Point-to-multipoint repair sender. More...

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <time.h>
#include <windows.h>
#include <io.h>
#include "../flutelib/flute.h"
#include "../flutelib/uri.h"
#include "../flutelib/mad_zlib.h"
#include "../alclib/blocking_alg.h"
#include "../alclib/alc_session.h"
#include "../alclib/alc_tx.h"
#include "repair_sender.h"

Include dependency graph for repair_sender.c:

Go to the source code of this file.

Functions

miss_block_tcreate_miss_block (void)
miss_obj_tcreate_miss_object (void)
void insert_miss_object (miss_obj_t *miss_obj)
void insert_miss_block (miss_block_t *miss_block, miss_obj_t *miss_obj)
miss_obj_tmiss_object_exist (unsigned long long toi)
miss_block_tmiss_block_exist (unsigned int sbn, miss_obj_t *miss_obj)
void free_miss_object_list (void)
int send_repair_data (char *file_path, int *s_id, int tx_mode, unsigned long long toi, unsigned short es_len, unsigned int max_sb_len, unsigned char fec_enc_id, unsigned short fec_inst_id, miss_obj_t *miss_obj)
int repair_sender_in_fdt_based_mode (int *s_id, arguments_t *a)
int repair_sender (arguments_t *a, int *s_id)
int parse_repair_sender_conf_file (arguments_t *a)
int parse_flute_conf_file (arguments_t *a)

Variables

miss_obj_tmiss_obj_list


Detailed Description

Point-to-multipoint repair sender.

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

MAD-REPAIR-SENDER: Implementation of simple point-to-multipoint repair for 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 repair_sender.c.


Function Documentation

miss_block_t* create_miss_block ( void   ) 

This is a private function which creates missing block structure.

Returns:
missing block structure in success, NULL otherwise

Definition at line 68 of file repair_sender.c.

Referenced by repair_sender_in_fdt_based_mode().

Here is the caller graph for this function:

miss_obj_t* create_miss_object ( void   ) 

This is a private function which creates missing object structure.

Returns:
missing object structure in success, NULL otherwise

Definition at line 87 of file repair_sender.c.

Referenced by repair_sender_in_fdt_based_mode().

Here is the caller graph for this function:

void free_miss_object_list ( void   ) 

This is a private function which frees missing object list.

Definition at line 266 of file repair_sender.c.

References miss_obj::block_list, miss_obj_list, miss_obj::next, and miss_block::next.

Referenced by repair_sender_in_fdt_based_mode().

Here is the caller graph for this function:

void insert_miss_block ( miss_block_t miss_block,
miss_obj_t miss_obj 
)

This is a private function which insert missing block to the missing object.

Parameters:
miss_block missing block structure to be inserted
miss_obj missing object structure where to insert

Definition at line 157 of file repair_sender.c.

References miss_obj::block_list, miss_block::next, miss_block::prev, and miss_block::sbn.

Referenced by repair_sender_in_fdt_based_mode().

Here is the caller graph for this function:

void insert_miss_object ( miss_obj_t miss_obj  ) 

This is a private function which insert missing object to the missing object list.

Parameters:
miss_obj missing object structure to be inserted

Definition at line 106 of file repair_sender.c.

References miss_obj_list, miss_obj::next, miss_obj::prev, and miss_obj::toi.

Referenced by repair_sender_in_fdt_based_mode().

Here is the caller graph for this function:

miss_block_t* miss_block_exist ( unsigned int  sbn,
miss_obj_t miss_obj 
)

This is a private function which return missing block structure if it exists.

Parameters:
sbn source block number
miss_obj missing object structure where to look missing block
Returns:
missing block structure in success, NULL otherwise

Definition at line 239 of file repair_sender.c.

References miss_obj::block_list, miss_block::next, and miss_block::sbn.

Referenced by repair_sender_in_fdt_based_mode(), and send_repair_data().

Here is the caller graph for this function:

miss_obj_t* miss_object_exist ( unsigned long long  toi  ) 

This is a private function which return missing object structure if it exists.

Parameters:
toi transport object identifier
Returns:
missing object structure in success, NULL otherwise

Definition at line 209 of file repair_sender.c.

References miss_obj_list, miss_obj::next, and miss_obj::toi.

Referenced by repair_sender_in_fdt_based_mode().

Here is the caller graph for this function:

int parse_flute_conf_file ( arguments_t a  ) 

This function parses FLUTE configuration file for repair sender.

Parameters:
a arguments structure where command line arguments are parsed
Return: int: 0 in success, -1 otherwise

Definition at line 1063 of file repair_sender.c.

References arguments::alc_a, alc_arguments::base_dir, arguments::fdt_file, alc_arguments::fec_ratio, arguments::flute_conf_file, and MAX_PATH_LENGTH.

int parse_repair_sender_conf_file ( arguments_t a  ) 

Definition at line 984 of file repair_sender.c.

References arguments::flute_conf_file, MAX_PATH_LENGTH, arguments::repair, arguments::requested_blocks_file, and arguments::sdp_file.

Referenced by repair_sender().

Here is the caller graph for this function:

int repair_sender ( arguments_t a,
int *  s_id 
)

This function is repair sender's main function.

Parameters:
a arguments structure where command line arguments are parsed
s_id session identifier
Returns:
0 in success, -1 in error cases, -2 when state is SExiting

Definition at line 841 of file repair_sender.c.

References add_alc_channel(), alc_arguments::addr, alc_arguments::addr_family, arguments::alc_a, close_alc_session(), increase_ipv6_address(), alc_arguments::intface, alc_arguments::intface_name, MAX_CHANNELS_IN_SESSION, MAX_PORT_LENGTH, alc_arguments::nb_channel, open_alc_session(), parse_flute_conf_file(), parse_repair_sender_conf_file(), parse_sdp_file(), alc_arguments::port, arguments::repair, repair_sender_in_fdt_based_mode(), arguments::sdp_file, and alc_arguments::stop_time.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int repair_sender_in_fdt_based_mode ( int *  s_id,
arguments_t a 
)

This function sends repair data for the files defined in the FDT file.

Parameters:
s_id session identifier
a arguments structure where command line arguments are parsed
Returns:
0 in success, -1 in error cases, -2 when state is SExiting

Definition at line 465 of file repair_sender.c.

References arguments::alc_a, alc_arguments::base_dir, miss_obj::block_list, arguments::cont, file::content_len, create_miss_block(), create_miss_object(), decode_fdt_payload(), alc_arguments::encode_content, file::es_len, alc_arguments::es_len, FALSE, arguments::fdt_file, file::fec_enc_id, alc_arguments::fec_enc_id, file::fec_inst_id, alc_arguments::fec_inst_id, file, free_miss_object_list(), free_uri(), FreeFDT(), GZ_SUFFIX, insert_miss_block(), insert_miss_object(), file::location, file::max_nb_of_es, MAX_PATH_LENGTH, file::max_sb_len, alc_arguments::max_sb_len, MEM_ERROR, miss_block_exist(), miss_object_exist(), alc_arguments::nb_tx, file::next, miss_block::next, NO_TX_THREAD, parse_uri(), uri::path, arguments::requested_blocks_file, SB_SYS_FEC_ENC_ID, miss_block::sbn, send_repair_data(), set_session_a_flag_usage(), set_session_state(), SExiting, file::toi, miss_obj::toi, file::transfer_len, TRUE, alc_arguments::use_fec_oti_ext_hdr, and ZLIB_FDT_AND_GZIP_FILES.

Referenced by repair_sender().

Here is the call graph for this function:

Here is the caller graph for this function:

int send_repair_data ( char *  file_path,
int *  s_id,
int  tx_mode,
unsigned long long  toi,
unsigned short  es_len,
unsigned int  max_sb_len,
unsigned char  fec_enc_id,
unsigned short  fec_inst_id,
miss_obj_t miss_obj 
)

This is a private function sends needed repair data for one file.

Parameters:
file_path file path for the repaired file
s_id session identifier
tx_mode transmission mode
toi transport object identifier
es_len encoding symbol length
max_sb_len maximum source block length
fec_enc_id FEC encoding id
fec_inst_id FEC instance id
miss_obj missing object structure
Returns:
0 in success, -1 in error cases, -2 when state is SExiting

Definition at line 309 of file repair_sender.c.

References blocking_struct::A_large, blocking_struct::A_small, alc_send(), miss_obj::block_list, compute_blocking_structure(), blocking_struct::I, miss_block_exist(), set_object_last_print_tx_percent(), and set_object_sent_bytes().

Referenced by repair_sender_in_fdt_based_mode().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

miss_obj_t* miss_obj_list

Stores information about missing objects

Definition at line 59 of file repair_sender.c.

Referenced by free_miss_object_list(), insert_miss_object(), and miss_object_exist().


Generated on Fri Mar 9 20:03:42 2007 for MAD-FCL by  doxygen 1.5.0