/***************************************************************************
* DBS: Distributed Benchmark System
* Copyright (c) 1995, 1996, 1997 Yukio Murayama
* Copyright (c) 1995, 1996, 1997 Nara Institute of Science and Technology
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided only with the following
* conditions are satisfied:
*
* 1. Both the copyright notice and this permission notice appear in
* all copies of the software, derivative works or modified versions,
* and any portions thereof, and that both notices appear in
* supporting documentation.
* 2. All advertising materials mentioning features or use of this
* software must display the following acknowledgement:
* This product includes software developed by Nara Institute of
* Science and Technology and its contributors.
* 3. Neither the name of Nara Institute of Science and Technology nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND NARA
* INSTITUTE OF SCIENCE AND TECHNOLOGY DISCLAIMS ANY LIABILITY OF
* ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
* THIS SOFTWARE. ALSO, THERE IS NO WARRANTY IMPLIED OR OTHERWISE,
* NOR IS SUPPORT PROVIDED.
*
* Feedback of the results generated from any improvements or
* extensions made to this software would be much appreciated.
* Any such feedback should be sent to:
*
* Yukio Murayama
* E-mail: <yukio-m@is.aist-nara.ac.jp>
* URL: <http://shika.aist-nara.ac.jp/member/yukio-m/index.html>
* Address: Graduate School of Information Science,
* Nara Institute of Science and Technology,
* Takayama 8916-5, Ikoma, Nara, Japan
*
* Nara Institute of Science and Technology has the rights to
* redistribute these changes.
***************************************************************************/
/*****************************************************************
* Distributed Benchmark System
* DBSD Header File
* $Revision: 1.13 $
* $Date: 1997/02/11 03:14:41 $
* $Author: yukio-m $
*****************************************************************/
/*
* Data Structure For DBSD Modules
*/
/**** START of DBS Daemon's list ****/
/* Socket Option */
struct sock_opt {
int send_buff; /* Send Buffer Size */
int recv_buff; /* Receive Buffer Size(byte) */
int so_debug; /* SO_DEBUG ON or OFF */
int no_delay; /* NO_DELAY ON or OFF */
int mss; /* MSS */
};
/* Assosiation */
struct assosiation {
char dsthostname[MAXHOSTNAME]; /* Destination Hostname */
char srchostname[MAXHOSTNAME]; /* Source Hostname */
int transport; /* 1:TCP 2:UDP */
u_int source_address; /* Source Address */
u_short source_port; /* Source Port */
u_int dest_address; /* Destination Address */
u_short dest_port; /* Destination Port */
};
/* DBS Traffic Pattern List*/
struct dbsd_traffic {
int size;
int packet;
struct timeval isleep;
struct timeval esleep;
int esleep_flag;
int isleep_flag;
};
struct dbsd_param {
/* ASSOSIATION */
struct assosiation assosiation;
struct sock_opt sock_opt;
/* CONNECTION */
int connection_mode; /* BEFORE or AFTER */
int fd; /* file descripter */
int sockfd; /* socket file descripter */
struct sockaddr_in b_address;
struct sockaddr_in d_address;
/* TCP TRACE */
int tcp_trace;
int trace_buff;
/* TRAFFIC*/
int sendflg; /* 1:SEND 2:RECEIVE */
int serverflg; /* 1:SERVER 2:CLIENT */
struct dbsd_traffic *traffic; /* Traffic Pattern */
int traffic_n; /* Traffic Pattern */
int buf_size; /* Send or Receive Buffer Size (number)*/
int mem_align; /* Memory Align */
int align_offset; /* Memory Align Offset */
int align_pad; /* Memory Align Pad */
/* TIME */
struct timeval start_time; /* Start Time */
struct timeval end_time; /* End Time */
/* Only Sender */
int send_times; /* Sending Times (times) */
/* Only Receiver */
int record_buff;
int total_size; /* Total Data Size (byte) */
int total_message; /* Total Messages (Times) */
int recv_mode; /* RECV_MODE */
};
/**** END of DBS Daemon's list ****/
/***** net.c *****/
int tcp_init_server __P((struct assosiation *a, struct dbsd_param *cmd));
int tcp_init_server2 __P((struct assosiation *a, struct dbsd_param *cmd));
int tcp_init_client __P((struct assosiation *a, struct dbsd_param *cmd));
int udp_init __P((struct assosiation *a, struct dbsd_param *cmd));
void getaddr __P((struct assosiation *a, struct sockaddr_in *d_address, struct sockaddr_in *b_address));
void setaddr __P((int fd, struct assosiation *a));
/***** dbsd.c *****/
void safe_exit __P((int signo, char *msg, char *error));
syntax highlighted by Code2HTML, v. 0.9.1