Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

options.h File Reference

#include <stdarg.h>
#include "structs.h"
#include "packet.h"

Go to the source code of this file.

Defines

#define ARTP_OPTIONS_H   1
#define OPTIONS_COUNT   3

Enumerations

enum  artp_session_options { MAX_MSS, MAX_DGRAM_LEN, RETRANSMITS_TIMEOUT }

Functions

int options_init ()
int set_global_option (char *option_name, char *option_value, int use)
int set_default_options (struct session_item *session)
int get_session_options (struct session_item *session, struct artp_dgram *dgram, char **options, int *size)
int parse_session_options (struct session_item *session, char *options, int size)
int use_options (struct session_item *session, int use, enum artp_session_options option_id, va_list *ap)


Detailed Description

ARTP options definition and their manipulating functions.
Author:
Tomas Rebok
Date:
2004

Define Documentation

#define OPTIONS_COUNT   3
 

The total options count.


Enumeration Type Documentation

enum artp_session_options
 

The list of available options.

Enumeration values:
MAX_MSS  maximal MSS Send this option to your partner when you want to receive packets that has to be lesser than given size.
MAX_DGRAM_LEN  maximal datagram size Send this option to your partner when you want to receive datagrams that has to be lesser than given size.
RETRANSMITS_TIMEOUT  retransmits' timeout This option is used for receiver's determining too old information in his packets history (history used for determining duplicities).

NOTE: If you're sure that you will send less than 2^32 packets you may not use this option.


Function Documentation

int get_session_options struct session_item   session,
struct artp_dgram   dgram,
char **    options,
int *    size
 

Find out session options. This function finds out options which has to be sent as a part of ARTP packet. There're returned no options for non-established sessions.

Parameters:
session  the pointer to the place where session information is stored.
packet  the pointer to the place where currently send packet is stored (currently unused - for further purposes).
options  the relevant pointer which will be moved to the place where returned options will be stored.
size  the pointer to the place where size of returned options will be stored.
Returns:
zero success
Returns:
nonzero related error code if something failed (for further information see documentation of file errors.h).

int options_init  
 

Initialize options. This function initializes options - creates necessary structure and sets default options which has to be set for each session.

Returns:
zero success
Returns:
nonzero related error code if something failed (for further information see documentation of file errors.h).

int parse_session_options struct session_item   session,
char *    options,
int    size
 

Parse session options. This function is used for parsing received options and saving their values to relevant structure. Previously saved (and allocated) options which wasn't covered in parsed string will be unallocated.

Parameters:
session  the pointer to the place where session information is stored.
options  the pointer to the place where options to parse are stored.
size  given options size.
Returns:
zero success
Returns:
nonzero related error code if something failed (for further information see documentation of file errors.h).

int set_default_options struct session_item   session
 

Set default session options. This function is used for setting defaultly set options for given session.

Parameters:
session  the pointer to the place where session information is stored.
Returns:
zero success
Returns:
nonzero related error code if something failed (for further information see documentation of file errors.h).

int set_global_option char *    option_name,
char *    option_value,
int    use
 

Set global sessions options. This function sets global sessions options as read from config file.

Parameters:
option_name  the pointer to the space where option name is stored.
option_value  the pointer to the space where option value is stored.
use  indicates whether this option has to be used or not (0 = don't use, 1 = use).

int use_options struct session_item   session,
int    use,
enum artp_session_options    option_id,
va_list *    ap
 

Set options using. This function is used for setting using of defined options (and their values).

Parameters:
session  the pointer to the place where session information is stored.
use  indicates whether this option will be used or not (0 = don't use, 1 = use).
option_id  option identification number.
ap  the pointer to the place where variable parameters list is stored (the option value is obtained from this list).
Returns:
zero success
Returns:
nonzero related error code if something failed (for further information see documentation of file errors.h).


Generated on Fri May 21 08:02:47 2004 for Active Router Transport Protocol (ARTP) by doxygen1.2.15