Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

artp.h

Go to the documentation of this file.
00001 /*
00002  * Active Router Transport Protocol (ARTP) implementation
00003  * Copyright (c) 2004, Tomas Rebok
00004  * All rights reserved.
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the "BSD License" which is
00008  * distributed with the software in the file LICENSE.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the BSD
00013  * License for more details.
00014  */
00015 
00023 #ifndef ARTP_H
00024 #define ARTP_H   1
00025 
00026 
00027 #include <sys/socket.h>
00028 #include <sys/types.h>
00029 #include <netinet/in.h>
00030 #include <arpa/inet.h>
00031 #include "packet.h"
00032 #include "options.h"
00033 #include "errors.h"
00034 
00035 
00037 enum artp_session_params { 
00043     RETRIES_TIMEOUT, 
00044     
00048     MSS, 
00049 
00053     EXP_TIME, 
00054 
00059     MAX_ACKS_COUNT,
00060     
00065     MAX_SBUFFER_SIZE,
00066 
00071     MAX_RBUFFER_SIZE,
00072     
00079     MAX_RBUFFER_RED_LIMIT,
00080     
00085     MAX_RBUFFER_RED_PROBABILITY
00086 };
00087 
00088 
00108 extern int 
00109 artp_init(int sckt, char *filename);
00110 
00111 
00130 extern int 
00131 artp_prepare_connection(SID_TYPE sid, struct sockaddr *receiver);
00132 
00133 
00153 extern int 
00154 artp_destroy_connection(SID_TYPE sid, struct sockaddr *receiver);
00155 
00156 
00179 extern int 
00180 artp_send_dgram(struct artp_dgram *dgram, SID_TYPE sid, 
00181         struct sockaddr *receiver);
00182 
00183 
00205 extern int 
00206 artp_receive_dgram(SID_TYPE sid, struct sockaddr *sender, 
00207         struct artp_dgram *dgram);
00208 
00209 
00232 extern int 
00233 artp_receive_any_dgram(SID_TYPE *sid, struct sockaddr **sender, 
00234         struct artp_dgram *dgram);
00235 
00236 
00251 extern int 
00252 artp_free_dgram(struct artp_dgram *dgram);
00253 
00254 
00274 extern int 
00275 artp_get_undlvr_session(SID_TYPE *sid, struct sockaddr *receiver);
00276 
00277 
00296 extern int 
00297 artp_get_sid(struct sockaddr *receiver, SID_TYPE *sid);
00298 
00299 
00328 extern int 
00329 artp_set_session_options(SID_TYPE sid, struct sockaddr *receiver, int use, 
00330         enum artp_session_options option, ...);
00331 
00332 
00356 extern int 
00357 artp_set_session_params(SID_TYPE sid, struct sockaddr *sender, 
00358         enum artp_session_params param, ...);
00359 
00360 
00361 #endif
00362 
00363 /* vim: set ts=4 : */

Generated on Fri May 21 07:50:24 2004 for Active Router Transport Protocol (ARTP) by doxygen1.2.15