diam_tcp.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifdef DIAM_ACC
00030
00031 #ifndef ACC_TCP
00032 #define ACC_TCP
00033
00034 #include "../../str.h"
00035 #include "../../parser/msg_parser.h"
00036
00037
00038 typedef struct rd_buf
00039 {
00040 unsigned int first_4bytes;
00041 unsigned int buf_len;
00042 unsigned char *buf;
00043 } rd_buf_t;
00044
00045
00046 #define AAA_ERROR -1
00047 #define AAA_CONN_CLOSED -2
00048 #define AAA_TIMEOUT -3
00049 #define ACC_SUCCESS 0
00050 #define ACC_FAILURE 1
00051
00052 #define AAA_NO_CONNECTION -1
00053
00054 #define MAX_WAIT_SEC 2
00055 #define MAX_WAIT_USEC 0
00056
00057 #define MAX_AAA_MSG_SIZE 65536
00058
00059 #define CONN_SUCCESS 1
00060 #define CONN_ERROR -1
00061 #define CONN_CLOSED -2
00062
00063 #define MAX_TRIES 10
00064
00065 int sockfd;
00066
00067 int do_read( int socket, rd_buf_t *p);
00068 void reset_read_buffer(rd_buf_t *rb);
00069
00070
00071 int init_mytcp(char* host, int port);
00072
00073 int tcp_send_recv(int sockfd, char* buf, int len, rd_buf_t* rb,
00074 unsigned int waited_id);
00075 void close_tcp_connection(int sfd);
00076
00077 int get_uri(struct sip_msg* m, str** uri);
00078 #endif
00079
00080 #endif