/*****************************************************************************
 *    (C) Copyright Fujitsu Limited 2011
 *
 *    1. FILE NAME    : fe_ike_sock.h
 *    2. FILE ID      :
 *    3. COMPONENT    : IKED
 *    4. ACTOR        :
 *    5. WRITTEN BY   : kinn tyuuketu
 *    6. DATE         : 2011/11/30
 *    7. DESCRIPTION  :
 *****************************************************************************/
/* $Id: fe_ike_sock.h 738 2011-12-20 16:08:14Z hayabusa $ */
#ifndef __TCP_SOCK_H__
#define __TCP_SOCK_H__
#include <stdlib.h>
#include <errno.h>
#include <sys/time.h> 
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#define SO_RCVBUF_SIZE          4096    // 受信バッファサイズ指定
#define SO_SNDBUF_SIZE          4096    // 送信バッファサイズ指定

#define GDB_PRINTF(f_, ...)   printf(  "[%s][%d]" f_ , __FILE__, __LINE__, ##__VA_ARGS__)

#define SERVER_SOCK_PORT   3333        //接続待ちポート番号

#define MAX_SOCKET      20          // 保留中の接続のキューの最大長


struct  fd_list{
    int   fd; 			// ソケットのFD
    int   module;		// モジュールID
};

int recv_mesg( int fd, char **message );
int send_mesg( int fd, char *ctx );
int wait_io( int fd, int flg );
int set_nonblocking(int sockfd);
int set_blocking(int sockfd);

#endif
