fdt.c File Reference

FDT parsing. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <windows.h>
#include <expat.h>
#include "../alclib/fec.h"
#include "fdt.h"
#include "mad_utf8.h"

Include dependency graph for fdt.c:

Go to the source code of this file.

Functions

void lock_fdt (void)
void unlock_fdt (void)
int copy_file_info (file_t *src, file_t *dest)
static void startElement_FDT (void *userData, const char *name, const char **atts)
void initialize_fdt_parser (void)
void release_fdt_parser (void)
fdt_tdecode_fdt_payload (char *fdt_payload)
void FreeFDT (fdt_t *fdt)
int update_fdt (fdt_t *fdt_db, fdt_t *instance)
file_tfind_file_with_toi (fdt_t *fdt, unsigned long long toi)
void PrintFDT (fdt_t *fdt, int s_id)
void free_file (file_t *file)

Variables

fdt_tfdt
file_tfile
file_tprev
BOOL is_first_toi
RTL_CRITICAL_SECTION global_variables_semaphore


Detailed Description

FDT parsing.

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

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.c.


Function Documentation

int copy_file_info ( file_t src,
file_t dest 
)

This is a private function which copies file description from source to destination.

Parameters:
src pointer to source file structure
dest pointer to destination file structure
Returns:
1 if file description is updated, 0 if not, and -1 in error cases

Definition at line 103 of file fdt.c.

References file::content_len, file::encoding, file::es_len, file::expires, file::fec_enc_id, file::fec_inst_id, file::location, file::max_nb_of_es, file::max_sb_len, file::md5, file::toi, file::transfer_len, and file::type.

Referenced by update_fdt().

Here is the caller graph for this function:

fdt_t* decode_fdt_payload ( char *  fdt_payload  ) 

This function decodes FDT XML document to the fdt structure using Expat XML library.

Parameters:
fdt_payload pointer to buffer containing FDT XML document
Returns:
pointer to the fdt structure, NULL in error cases

Definition at line 592 of file fdt.c.

References fdt::complete, fdt::encoding, fdt::es_len, fdt::expires, FALSE, fdt, fdt::fec_enc_id, fdt::fec_inst_id, file, fdt::file_list, fdt::finite_field, GF_BITS, is_first_toi, lock_fdt(), fdt::max_nb_of_es, fdt::max_sb_len, fdt::nb_of_es_per_group, fdt::nb_of_files, prev, startElement_FDT(), TRUE, fdt::type, and unlock_fdt().

Referenced by fdt_thread(), main(), remove_gz_files(), repair_sender_in_fdt_based_mode(), and sender_in_fdt_based_mode().

Here is the call graph for this function:

Here is the caller graph for this function:

file_t* find_file_with_toi ( fdt_t fdt,
unsigned long long  toi 
)

This function returns FDT information structure for wanted toi.

Parameters:
fdt pointer to FDT database
toi transport object identifier
Returns:
FDT information structure for wanted toi, NULL if FDT information does not exists

Definition at line 766 of file fdt.c.

References fdt, file, fdt::file_list, file::next, and file::toi.

Referenced by copy_file_name(), and copy_md5().

Here is the caller graph for this function:

void free_file ( file_t file  ) 

This function frees file structure.

Parameters:
file pointer to file structure

Definition at line 810 of file fdt.c.

References file::encoding, file, file::location, lock_fdt(), file::md5, file::type, and unlock_fdt().

Referenced by receiver_in_ui_mode().

Here is the call graph for this function:

Here is the caller graph for this function:

void FreeFDT ( fdt_t fdt  ) 

This function frees FDT structure.

Parameters:
fdt pointer to the FDT structure

Definition at line 648 of file fdt.c.

References file::encoding, fdt::encoding, fdt, file, fdt::file_list, file::location, lock_fdt(), file::md5, file::next, file::type, fdt::type, and unlock_fdt().

Referenced by fdt_thread(), flute_receiver_report(), flute_sender(), main(), and repair_sender_in_fdt_based_mode().

Here is the call graph for this function:

Here is the caller graph for this function:

void initialize_fdt_parser ( void   ) 

This function initializes FDT parser.

Definition at line 578 of file fdt.c.

References global_variables_semaphore.

Referenced by start_up_flute().

Here is the caller graph for this function:

void lock_fdt ( void   ) 

This is a private function, which locks the FDT.

Definition at line 72 of file fdt.c.

References global_variables_semaphore.

Referenced by decode_fdt_payload(), free_file(), FreeFDT(), PrintFDT(), and update_fdt().

Here is the caller graph for this function:

void PrintFDT ( fdt_t fdt,
int  s_id 
)

This function prints FDT information.

Parameters:
fdt pointer to FDT structure
s_id session identifier

Definition at line 780 of file fdt.c.

References file::encoding, fdt, file, fdt::file_list, file::location, lock_fdt(), file::next, file::toi, and unlock_fdt().

Referenced by fdt_thread().

Here is the call graph for this function:

Here is the caller graph for this function:

void release_fdt_parser ( void   ) 

This function releases FDT parser.

Definition at line 585 of file fdt.c.

References global_variables_semaphore.

Referenced by shut_down_flute(), and shut_down_flute2().

Here is the caller graph for this function:

static void startElement_FDT ( void *  userData,
const char *  name,
const char **  atts 
) [static]

This is a private function which is used in FDT parsing.

Parameters:
userData not used, must be
name pointer to buffer containing element's name
atts pointer to buffer containing element's attributes

Definition at line 241 of file fdt.c.

References fdt::complete, file::content_len, fdt::encoding, file::encoding, fdt::es_len, file::es_len, fdt::expires, file::expires, FALSE, fdt, fdt::fec_enc_id, file::fec_enc_id, fdt::fec_inst_id, file::fec_inst_id, file, fdt::file_list, fdt::finite_field, file::finite_field, is_first_toi, file::location, fdt::max_nb_of_es, file::max_nb_of_es, fdt::max_sb_len, file::max_sb_len, file::md5, fdt::nb_of_es_per_group, file::nb_of_es_per_group, fdt::nb_of_files, file::next, prev, file::prev, file::status, file::toi, file::transfer_len, TRUE, fdt::type, file::type, and x_utf8s_to_iso_8859_1s().

Referenced by decode_fdt_payload().

Here is the call graph for this function:

Here is the caller graph for this function:

void unlock_fdt ( void   ) 

This is a private function, which unlocks the FDT.

Definition at line 85 of file fdt.c.

References global_variables_semaphore.

Referenced by decode_fdt_payload(), free_file(), FreeFDT(), PrintFDT(), and update_fdt().

Here is the caller graph for this function:

int update_fdt ( fdt_t fdt_db,
fdt_t instance 
)

This function updates FDT database.

Parameters:
fdt_db pointer to FDT database
instance pointer to received FDT Instance
Returns:
1 if existing file description in the FDT database is complemented or 2 when new file description entity is added in the FDT database, 0 if FDT database is not updated, -1 in error cases

Definition at line 693 of file fdt.c.

References copy_file_info(), file::fec_enc_id, file::fec_inst_id, fdt::file_list, lock_fdt(), file::next, file::prev, file::toi, and unlock_fdt().

Here is the call graph for this function:


Variable Documentation

fdt_t* fdt

FDT

Definition at line 52 of file fdt.c.

Referenced by create_fdt_instance(), decode_fdt_payload(), find_file_with_toi(), FreeFDT(), IsFECOTIInFDT(), main(), PrintFDT(), remove_gz_files(), and startElement_FDT().

file_t* file

file

Definition at line 53 of file fdt.c.

Referenced by copy_file_name(), copy_md5(), create_fdt_instance(), decode_fdt_payload(), fdt_thread(), fdtbasedrecv(), fdtbasedsend(), find_file_with_toi(), flute_receiver_report(), free_file(), FreeFDT(), http_file_repair(), IsFECOTIInFDT(), main(), name_incomplete_objects(), parse_data(), print_receiver_info(), print_sender_info(), PrintFDT(), receiver_in_ui_mode(), remove_gz_files(), repair_sender_in_fdt_based_mode(), send_file(), and startElement_FDT().

RTL_CRITICAL_SECTION global_variables_semaphore

Global variables semaphore

Definition at line 62 of file fdt.c.

Referenced by initialize_fdt_parser(), lock_fdt(), release_fdt_parser(), and unlock_fdt().

BOOL is_first_toi

is first TOI parsed or not?

Definition at line 55 of file fdt.c.

Referenced by decode_fdt_payload(), and startElement_FDT().

file_t* prev

previous parsed file

Definition at line 54 of file fdt.c.

Referenced by decode_fdt_payload(), mad_rlc_remove_late(), mad_rlc_update_late_list(), mad_rlc_update_loss_list(), sdp_fec_dec_get(), and startElement_FDT().


Generated on Fri Mar 9 20:08:56 2007 for MAD-FCL by  doxygen 1.5.0