mad.c File Reference

General ALC stuff. More...

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include "mad.h"

Include dependency graph for mad.c:

Go to the source code of this file.

Functions

void sec_init (void)
void alc_init (void)
double sec (void)
int increase_ipv6_address (struct in6_addr *ipv6)
int randomloss (double lossprob)
lldiv_t lldiv (long long num, long long denom)

Variables

BOOL lib_init = FALSE
double time_factor
unsigned long long start_time


Detailed Description

General ALC stuff.

Author
peltotal
Date
2007/02/28 08:58:00
Revision
1.27

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


Function Documentation

void alc_init ( void   ) 

This function initializes the library.

Definition at line 70 of file mad.c.

References lib_init, sec_init(), and TRUE.

Referenced by open_alc_session().

Here is the call graph for this function:

Here is the caller graph for this function:

int increase_ipv6_address ( struct in6_addr *  ipv6  ) 

This function increses IPv6 address by one.

Parameters:
ipv6 pointer to IPv6 address to be increased
Returns:
0 in success, -1 otherwise

Definition at line 96 of file mad.c.

Referenced by flute_receiver_report(), flute_sender(), mad_rlc_process_rx_sp(), main(), parse_sdp_file(), and repair_sender().

Here is the caller graph for this function:

lldiv_t lldiv ( long long  num,
long long  denom 
)

Definition at line 189 of file mad.c.

References lldiv_t::quot, and lldiv_t::rem.

Referenced by compute_blocking_structure().

Here is the caller graph for this function:

int randomloss ( double  lossprob  ) 

This function simulates packets losses randomly.

Parameters:
lossprob loss probability percent
Returns:
1 if packet should be dropped, 0 otherwize

Definition at line 161 of file mad.c.

double sec ( void   ) 

This function return number of seconds since sec_init() function was called.

Returns:
time since sec_init() was called

Definition at line 79 of file mad.c.

References start_time, and time_factor.

Referenced by mad_rlc_add_late(), mad_rlc_add_lost(), mad_rlc_analyze_cci(), mad_rlc_fill_header(), mad_rlc_next_sp(), mad_rlc_update_late_list(), osip_usleep(), and tx_thread().

Here is the caller graph for this function:

void sec_init ( void   ) 

This function initializes timer.

Definition at line 62 of file mad.c.

References start_time, and time_factor.

Referenced by alc_init().

Here is the caller graph for this function:


Variable Documentation

BOOL lib_init = FALSE

Is library initialized?

Definition at line 50 of file mad.c.

Referenced by alc_init(), and open_alc_session().

unsigned long long start_time

local global variable for timer

Definition at line 54 of file mad.c.

Referenced by parse_sdp_file(), sec(), and sec_init().

double time_factor

local global variable for timer

Definition at line 53 of file mad.c.

Referenced by sec(), and sec_init().


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