nettest_sdp.h
上传用户:kvgkvg
上传日期:2015-05-07
资源大小:1129k
文件大小:7k
源码类别:

Linux/Unix编程

开发平台:

C/C++

  1. /*
  2.         Copyright (C) 2007 Hewlett-Packard Company
  3. */
  4.  /* This file contains the test-specific definitions for netperf's SDP */
  5.  /* sockets tests */
  6. /* one of these days, this should not be required */
  7. #ifndef AF_INET_SDP
  8. #define AF_INET_SDP 27
  9. #define PF_INET_SDP AF_INET_SDP
  10. #endif 
  11. struct sdp_stream_request_struct {
  12.   int send_buf_size;
  13.   int recv_buf_size; /* how big does the client want it - the */
  14. /* receive socket buffer that is */ 
  15.   int receive_size;   /* how many bytes do we want to receive at one */
  16. /* time? */ 
  17.   int recv_alignment; /* what is the alignment of the receive */
  18. /* buffer? */ 
  19.   int recv_offset;    /* and at what offset from that alignment? */ 
  20.   int no_delay;       /* do we disable the nagle algorithm for send */
  21. /* coalescing? */ 
  22.   int measure_cpu; /* does the client want server cpu utilization */
  23. /* measured? */ 
  24.   float cpu_rate; /* do we know how fast the cpu is already? */ 
  25.   int test_length; /* how long is the test? */
  26.   int so_rcvavoid;    /* do we want the remote to avoid copies on */
  27. /* receives? */ 
  28.   int so_sndavoid;    /* do we want the remote to avoid send copies? */
  29.   int   dirty_count;    /* how many integers in the receive buffer */
  30. /* should be made dirty before calling recv? */  
  31.   int   clean_count;    /* how many integers should be read from the */
  32. /* recv buffer before calling recv? */ 
  33.   int   port; /* the to port to which recv side should bind
  34.    to allow netperf to run through firewalls */
  35.   int   ipfamily; /* address family of ipaddress */
  36.   int   non_blocking;   /* run the test in non-blocking mode */
  37. };
  38. struct sdp_stream_response_struct {
  39.   int recv_buf_size; /* how big does the client want it */
  40.   int receive_size;
  41.   int no_delay;
  42.   int measure_cpu; /* does the client want server cpu */
  43.   int test_length; /* how long is the test? */
  44.   int send_buf_size;
  45.   int data_port_number; /* connect to me here */
  46.   float cpu_rate; /* could we measure */
  47.   int so_rcvavoid; /* could the remote avoid receive copies? */ 
  48.   int so_sndavoid; /* could the remote avoid send copies? */
  49.   int   non_blocking;   /* run the test in non-blocking mode */
  50. };
  51. struct sdp_stream_results_struct {
  52.   double         bytes_received;
  53.   unsigned int  recv_calls;
  54.   float          elapsed_time; /* how long the test ran */
  55.   float          cpu_util; /* -1 if not measured */
  56.   float          serv_dem; /* -1 if not measured */
  57.   int            cpu_method;    /* how was cpu util measured? */
  58.   int            num_cpus;      /* how many CPUs had the remote? */
  59. };
  60. struct sdp_rr_request_struct {
  61.   int recv_buf_size; /* how big does the client want it */
  62.   int send_buf_size;
  63.   int recv_alignment;
  64.   int recv_offset;
  65.   int send_alignment;
  66.   int send_offset;
  67.   int request_size;
  68.   int response_size;
  69.   int no_delay;
  70.   int measure_cpu; /* does the client want server cpu */
  71.   float cpu_rate; /* do we know how fast the cpu is? */
  72.   int test_length; /* how long is the test? */
  73.   int so_rcvavoid;    /* do we want the remote to avoid receive */
  74. /* copies? */ 
  75.   int so_sndavoid;    /* do we want the remote to avoid send copies? */
  76.   int   port; /* the to port to which recv side should bind
  77.    to allow netperf to run through firewalls */
  78.   int   ipfamily; /* address family of ipaddress */
  79.   int   non_blocking;   /* run the test in non-blocking mode */
  80. };
  81. struct sdp_rr_response_struct {
  82.   int recv_buf_size; /* how big does the client want it */
  83.   int no_delay;
  84.   int measure_cpu; /* does the client want server cpu */
  85.   int test_length; /* how long is the test? */
  86.   int send_buf_size;
  87.   int data_port_number; /* connect to me here */
  88.   float cpu_rate; /* could we measure */
  89.   int so_rcvavoid; /* could the remote avoid receive copies? */
  90.   int so_sndavoid; /* could the remote avoid send copies? */
  91.   int   non_blocking;   /* run the test in non-blocking mode */
  92. };
  93. struct sdp_rr_results_struct {
  94.   unsigned int  bytes_received; /* ignored initially */
  95.   unsigned int recv_calls; /* ignored initially */
  96.   unsigned int trans_received; /* not ignored  */
  97.   float         elapsed_time; /* how long the test ran */
  98.   float         cpu_util; /* -1 if not measured */
  99.   float         serv_dem; /* -1 if not measured */
  100.   int           cpu_method;    /* how was cpu util measured? */
  101.   int           num_cpus;      /* how many CPUs had the remote? */
  102. };
  103. struct sdp_maerts_request_struct {
  104.   int send_buf_size;
  105.   int recv_buf_size; /* how big does the client want it - the */
  106. /* receive socket buffer that is */ 
  107.   int send_size;      /* how many bytes do we want netserver to send
  108.    at one time? */
  109.   int send_alignment; /* what is the alignment of the send */
  110. /* buffer? */ 
  111.   int send_offset;    /* and at what offset from that alignment? */ 
  112.   int no_delay;       /* do we disable the nagle algorithm for send */
  113. /* coalescing? */ 
  114.   int measure_cpu; /* does the client want server cpu utilization */
  115. /* measured? */ 
  116.   float cpu_rate; /* do we know how fast the cpu is already? */ 
  117.   int test_length; /* how long is the test? */
  118.   int so_rcvavoid;    /* do we want the remote to avoid copies on */
  119. /* receives? */ 
  120.   int so_sndavoid;    /* do we want the remote to avoid send copies? */
  121.   int   dirty_count;    /* how many integers in the send buffer */
  122. /* should be made dirty before calling recv? */  
  123.   int   clean_count;    /* how many integers should be read from the */
  124. /* recv buffer before calling recv? */ 
  125.   int   port;           /* the port to which the recv side should bind
  126.    to allow netperf to run through those evil
  127.    firewall things */
  128.   int   ipfamily;
  129. };
  130. struct sdp_maerts_response_struct {
  131.   int recv_buf_size; /* how big does the client want it */
  132.   int send_size;
  133.   int no_delay;
  134.   int measure_cpu; /* does the client want server cpu */
  135.   int test_length; /* how long is the test? */
  136.   int send_buf_size;
  137.   int data_port_number; /* connect to me here */
  138.   float cpu_rate; /* could we measure */
  139.   int so_rcvavoid; /* could the remote avoid receive copies? */ 
  140.   int so_sndavoid; /* could the remote avoid send copies? */
  141. };
  142. struct sdp_maerts_results_struct {
  143.   double         bytes_sent;
  144.   unsigned int  send_calls;
  145.   float          elapsed_time; /* how long the test ran */
  146.   float          cpu_util; /* -1 if not measured */
  147.   float          serv_dem; /* -1 if not measured */
  148.   int            cpu_method;    /* how was cpu util measured? */
  149.   int            num_cpus;      /* how many CPUs had the remote? */
  150. };
  151. extern void send_sdp_stream();
  152. extern void send_sdp_rr();
  153. extern void recv_sdp_stream();
  154. extern void recv_sdp_rr();
  155. extern void loc_cpu_rate();
  156. extern void rem_cpu_rate();