Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

options.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "options.h"
#include "config.h"
#include "errors.h"

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

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

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 07:50:25 2004 for Active Router Transport Protocol (ARTP) by doxygen1.2.15