home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / netper21.zip / nettest_bsd.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  10KB  |  275 lines

  1. /*
  2.         Copyright (C) 1993, Hewlett-Packard Company
  3. */
  4.  
  5.  /* This file contains the test-specific definitions for netperf's BSD */
  6.  /* sockets tests */
  7.  
  8. #define PAD_TIME 2
  9.  
  10. struct    tcp_stream_request_struct {
  11.   int    send_buf_size;
  12.   int    recv_buf_size;    /* how big does the client want it - the */
  13.             /* receive socket buffer that is */ 
  14.   int    receive_size;   /* how many bytes do we want to receive at one */
  15.             /* time? */ 
  16.   int    recv_alignment; /* what is the alignment of the receive */
  17.             /* buffer? */ 
  18.   int    recv_offset;    /* and at what offset from that alignment? */ 
  19.   int    no_delay;       /* do we disable the nagle algorithm for send */
  20.             /* coalescing? */ 
  21.   int    measure_cpu;    /* does the client want server cpu utilization */
  22.             /* measured? */ 
  23.   float    cpu_rate;    /* do we know how fast the cpu is already? */ 
  24.   int    test_length;    /* how long is the test?        */
  25.   int    so_rcvavoid;    /* do we want the remote to avoid copies on */
  26.             /* receives? */ 
  27.   int    so_sndavoid;    /* do we want the remote to avoid send copies? */
  28.   int   dirty_count;    /* how many integers in the receive buffer */
  29.             /* should be made dirty before calling recv? */  
  30.   int   clean_count;    /* how many integers should be read from the */
  31.             /* recv buffer before calling recv? */ 
  32. };
  33.  
  34. struct    tcp_stream_response_struct {
  35.   int    recv_buf_size;    /* how big does the client want it    */
  36.   int    receive_size;
  37.   int    no_delay;
  38.   int    measure_cpu;    /* does the client want server cpu    */
  39.   int    test_length;    /* how long is the test?        */
  40.   int    send_buf_size;
  41.   int    data_port_number;    /* connect to me here    */
  42.   float    cpu_rate;        /* could we measure    */
  43.   int    so_rcvavoid;    /* could the remote avoid receive copies? */ 
  44.   int    so_sndavoid;    /* could the remote avoid send copies? */
  45. };
  46.  
  47. struct tcp_stream_results_struct {
  48.   double         bytes_received;
  49.   unsigned int     recv_calls;    
  50.   float             elapsed_time;    /* how long the test ran */
  51.   float             cpu_util;    /* -1 if not measured */
  52.   float             serv_dem;    /* -1 if not measured */
  53.   int            cpu_method;    /* how was cpu util measured? */
  54.   int            num_cpus;      /* how many CPUs had the remote? */
  55. };
  56.  
  57. struct    tcp_rr_request_struct {
  58.   int    recv_buf_size;    /* how big does the client want it    */
  59.   int    send_buf_size;
  60.   int    recv_alignment;
  61.   int    recv_offset;
  62.   int    send_alignment;
  63.   int    send_offset;
  64.   int    request_size;
  65.   int    response_size;
  66.   int    no_delay;
  67.   int    measure_cpu;    /* does the client want server cpu    */
  68.   float    cpu_rate;    /* do we know how fast the cpu is?    */
  69.   int    test_length;    /* how long is the test?        */
  70.   int    so_rcvavoid;    /* do we want the remote to avoid receive */
  71.             /* copies? */ 
  72.   int    so_sndavoid;    /* do we want the remote to avoid send copies? */
  73. };
  74.  
  75. struct    tcp_rr_response_struct {
  76.   int    recv_buf_size;    /* how big does the client want it    */
  77.   int    no_delay;
  78.   int    measure_cpu;    /* does the client want server cpu    */
  79.   int    test_length;    /* how long is the test?        */
  80.   int    send_buf_size;
  81.   int    data_port_number;    /* connect to me here    */
  82.   float    cpu_rate;        /* could we measure    */
  83.   int    so_rcvavoid;    /* could the remote avoid receive copies? */
  84.   int    so_sndavoid;    /* could the remote avoid send copies? */
  85. };
  86.  
  87. struct tcp_rr_results_struct {
  88.   unsigned int  bytes_received;    /* ignored initially */
  89.   unsigned int    recv_calls;    /* ignored initially */
  90.   unsigned int    trans_received;    /* not ignored  */
  91.   float            elapsed_time;    /* how long the test ran */
  92.   float            cpu_util;    /* -1 if not measured */
  93.   float            serv_dem;    /* -1 if not measured */
  94.   int           cpu_method;    /* how was cpu util measured? */
  95.   int           num_cpus;      /* how many CPUs had the remote? */
  96. };
  97.  
  98. struct    tcp_conn_rr_request_struct {
  99.   int    recv_buf_size;    /* how big does the client want it    */
  100.   int    send_buf_size;
  101.   int    recv_alignment;
  102.   int    recv_offset;
  103.   int    send_alignment;
  104.   int    send_offset;
  105.   int    request_size;
  106.   int    response_size;
  107.   int    no_delay;
  108.   int    measure_cpu;    /* does the client want server cpu    */
  109.   float    cpu_rate;    /* do we know how fast the cpu is?    */
  110.   int    test_length;    /* how long is the test?        */
  111.   int    so_rcvavoid;    /* do we want the remote to avoid receive */
  112.             /* copies? */ 
  113.   int    so_sndavoid;    /* do we want the remote to avoid send copies? */
  114. };
  115.  
  116.  
  117. struct    tcp_conn_rr_response_struct {
  118.   int    recv_buf_size;    /* how big does the client want it    */
  119.   int    no_delay;
  120.   int    measure_cpu;    /* does the client want server cpu    */
  121.   int    test_length;    /* how long is the test?        */
  122.   int    send_buf_size;
  123.   int    data_port_number;    /* connect to me here    */
  124.   float    cpu_rate;        /* could we measure    */
  125.   int    so_rcvavoid;    /* could the remote avoid receive copies? */
  126.   int    so_sndavoid;    /* could the remote avoid send copies? */
  127. };
  128.  
  129. struct tcp_conn_rr_results_struct {
  130.   unsigned int    bytes_received;    /* ignored initially */
  131.   unsigned int    recv_calls;    /* ignored initially */
  132.   unsigned int    trans_received;    /* not ignored  */
  133.   float            elapsed_time;    /* how long the test ran */
  134.   float            cpu_util;    /* -1 if not measured */
  135.   float            serv_dem;    /* -1 if not measured */
  136.   int           cpu_method;    /* how was cpu util measured? */
  137.   int           num_cpus;      /* how many CPUs had the remote? */
  138. };
  139.  
  140. struct    tcp_tran_rr_request_struct {
  141.   int    recv_buf_size;    /* how big does the client want it    */
  142.   int    send_buf_size;
  143.   int    recv_alignment;
  144.   int    recv_offset;
  145.   int    send_alignment;
  146.   int    send_offset;
  147.   int    request_size;
  148.   int    response_size;
  149.   int    no_delay;
  150.   int    measure_cpu;    /* does the client want server cpu    */
  151.   float    cpu_rate;    /* do we know how fast the cpu is?    */
  152.   int    test_length;    /* how long is the test?        */
  153.   int    so_rcvavoid;    /* do we want the remote to avoid receive */
  154.             /* copies? */ 
  155.   int    so_sndavoid;    /* do we want the remote to avoid send copies? */
  156. };
  157.  
  158.  
  159. struct    tcp_tran_rr_response_struct {
  160.   int    recv_buf_size;    /* how big does the client want it    */
  161.   int    no_delay;
  162.   int    measure_cpu;    /* does the client want server cpu    */
  163.   int    test_length;    /* how long is the test?        */
  164.   int    send_buf_size;
  165.   int    data_port_number;    /* connect to me here    */
  166.   float    cpu_rate;        /* could we measure    */
  167.   int    so_rcvavoid;    /* could the remote avoid receive copies? */
  168.   int    so_sndavoid;    /* could the remote avoid send copies? */
  169. };
  170.  
  171. struct tcp_tran_rr_results_struct {
  172.   unsigned int    bytes_received;    /* ignored initially */
  173.   unsigned int    recv_calls;    /* ignored initially */
  174.   unsigned int    trans_received;    /* not ignored  */
  175.   float            elapsed_time;    /* how long the test ran */
  176.   float            cpu_util;    /* -1 if not measured */
  177.   float            serv_dem;    /* -1 if not measured */
  178.   int           cpu_method;    /* how was cpu util measured? */
  179.   int           num_cpus;      /* how many CPUs had the remote? */
  180.  
  181. };
  182.  
  183. struct    udp_stream_request_struct {
  184.   int    recv_buf_size;
  185.   int    message_size;
  186.   int    recv_alignment;
  187.   int    recv_offset;
  188.   int    checksum_off;
  189.   int    measure_cpu;
  190.   float    cpu_rate;
  191.   int    test_length;
  192.   int    so_rcvavoid;    /* do we want the remote to avoid receive */
  193.             /* copies? */ 
  194.   int    so_sndavoid;    /* do we want the remote to avoid send copies? */
  195. };
  196.  
  197. struct    udp_stream_response_struct {
  198.   int    recv_buf_size;
  199.   int    send_buf_size;
  200.   int    measure_cpu;
  201.   int    test_length;
  202.   int    data_port_number;
  203.   float    cpu_rate;
  204.   int    so_rcvavoid;    /* could the remote avoid receive copies? */
  205.   int    so_sndavoid;    /* could the remote avoid send copies? */
  206. };
  207.  
  208. struct    udp_stream_results_struct {
  209.   unsigned int    messages_recvd;
  210.   unsigned int    bytes_received;
  211.   float            elapsed_time;
  212.   float            cpu_util;
  213.   int           cpu_method;    /* how was cpu util measured? */
  214.   int           num_cpus;      /* how many CPUs had the remote? */
  215. };
  216.  
  217.  
  218. struct    udp_rr_request_struct {
  219.   int    recv_buf_size;    /* how big does the client want it    */
  220.   int    send_buf_size;
  221.   int    recv_alignment;
  222.   int    recv_offset;
  223.   int    send_alignment;
  224.   int    send_offset;
  225.   int    request_size;
  226.   int    response_size;
  227.   int    no_delay;
  228.   int    measure_cpu;    /* does the client want server cpu    */
  229.   float    cpu_rate;    /* do we know how fast the cpu is?    */
  230.   int    test_length;    /* how long is the test?        */
  231.   int    so_rcvavoid;    /* do we want the remote to avoid receive */
  232.             /* copies? */ 
  233.   int    so_sndavoid;    /* do we want the remote to avoid send copies? */
  234. };
  235.  
  236. struct    udp_rr_response_struct {
  237.   int    recv_buf_size;    /* how big does the client want it    */
  238.   int    no_delay;
  239.   int    measure_cpu;    /* does the client want server cpu    */
  240.   int    test_length;    /* how long is the test?        */
  241.   int    send_buf_size;
  242.   int    data_port_number;    /* connect to me here    */
  243.   float    cpu_rate;        /* could we measure    */
  244.   int    so_rcvavoid;    /* could the remote avoid receive copies? */
  245.   int    so_sndavoid;    /* could the remote avoid send copies? */
  246. };
  247.  
  248. struct udp_rr_results_struct {
  249.   unsigned int    bytes_received;    /* ignored initially */
  250.   unsigned int    recv_calls;    /* ignored initially */
  251.   unsigned int    trans_received;    /* not ignored  */
  252.   float            elapsed_time;    /* how long the test ran */
  253.   float            cpu_util;    /* -1 if not measured */
  254.   float            serv_dem;    /* -1 if not measured */
  255.   int           cpu_method;    /* how was cpu util measured? */
  256.   int           num_cpus;      /* how many CPUs had the remote? */
  257. };
  258.  
  259. extern void scan_sockets_args();
  260.  
  261. extern void send_tcp_stream();
  262. extern void send_tcp_rr();
  263. extern void send_tcp_conn_rr();
  264. extern void send_udp_stream();
  265. extern void send_udp_rr();
  266.  
  267. extern void recv_tcp_stream();
  268. extern void recv_tcp_rr();
  269. extern void recv_tcp_conn_rr();
  270. extern void recv_udp_stream();
  271. extern void recv_udp_rr();
  272.  
  273. extern void loc_cpu_rate();
  274. extern void rem_cpu_rate();
  275.