blob: 529785389171d71d16702b3b4d647dcce20b8ea6 [file] [log] [blame]
The Android Open Source Project02fb0ac2009-03-03 19:30:07 -08001/*
2 Copyright (C) 1993-2003 Hewlett-Packard Company
3*/
4
5 /* This file contains the test-specific definitions for netperf's BSD */
6 /* sockets tests */
7
8
9struct sctp_stream_request_struct {
10 int send_buf_size;
11 int recv_buf_size; /* how big does the client want it - the */
12 /* receive socket buffer that is */
13 int receive_size; /* how many bytes do we want to receive at one */
14 /* time? */
15 int recv_alignment; /* what is the alignment of the receive */
16 /* buffer? */
17 int recv_offset; /* and at what offset from that alignment? */
18 int no_delay; /* do we disable the nagle algorithm for send */
19 /* coalescing? */
20 int measure_cpu; /* does the client want server cpu utilization */
21 /* measured? */
22 float cpu_rate; /* do we know how fast the cpu is already? */
23 int test_length; /* how long is the test? */
24 int so_rcvavoid; /* do we want the remote to avoid copies on */
25 /* receives? */
26 int so_sndavoid; /* do we want the remote to avoid send copies? */
27 int dirty_count; /* how many integers in the receive buffer */
28 /* should be made dirty before calling recv? */
29 int clean_count; /* how many integers should be read from the */
30 /* recv buffer before calling recv? */
31 int port; /* the to port to which recv side should bind
32 to allow netperf to run through firewalls */
33 int ipfamily; /* address family of ipaddress */
34 int non_blocking; /* run the test in non-blocking mode */
35};
36
37struct sctp_stream_response_struct {
38 int recv_buf_size; /* how big does the client want it */
39 int receive_size;
40 int no_delay;
41 int measure_cpu; /* does the client want server cpu */
42 int test_length; /* how long is the test? */
43 int send_buf_size;
44 int data_port_number; /* connect to me here */
45 float cpu_rate; /* could we measure */
46 int so_rcvavoid; /* could the remote avoid receive copies? */
47 int so_sndavoid; /* could the remote avoid send copies? */
48 int non_blocking; /* run the test in non-blocking mode */
49};
50
51struct sctp_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
61struct sctp_rr_request_struct {
62 int recv_buf_size; /* how big does the client want it */
63 int send_buf_size;
64 int recv_alignment;
65 int recv_offset;
66 int send_alignment;
67 int send_offset;
68 int request_size;
69 int response_size;
70 int no_delay;
71 int measure_cpu; /* does the client want server cpu */
72 float cpu_rate; /* do we know how fast the cpu is? */
73 int test_length; /* how long is the test? */
74 int so_rcvavoid; /* do we want the remote to avoid receive */
75 /* copies? */
76 int so_sndavoid; /* do we want the remote to avoid send copies? */
77 int port; /* the to port to which recv side should bind
78 to allow netperf to run through firewalls */
79 int ipfamily; /* address family of ipaddress */
80 int non_blocking; /* run the test in non-blocking mode */
81};
82
83struct sctp_rr_response_struct {
84 int recv_buf_size; /* how big does the client want it */
85 int no_delay;
86 int measure_cpu; /* does the client want server cpu */
87 int test_length; /* how long is the test? */
88 int send_buf_size;
89 int data_port_number; /* connect to me here */
90 float cpu_rate; /* could we measure */
91 int so_rcvavoid; /* could the remote avoid receive copies? */
92 int so_sndavoid; /* could the remote avoid send copies? */
93 int non_blocking; /* run the test in non-blocking mode */
94};
95
96struct sctp_rr_results_struct {
97 unsigned int bytes_received; /* ignored initially */
98 unsigned int recv_calls; /* ignored initially */
99 unsigned int trans_received; /* not ignored */
100 float elapsed_time; /* how long the test ran */
101 float cpu_util; /* -1 if not measured */
102 float serv_dem; /* -1 if not measured */
103 int cpu_method; /* how was cpu util measured? */
104 int num_cpus; /* how many CPUs had the remote? */
105};
106
107#define SCTP_SNDRCV_INFO_EV 0x01
108#define SCTP_ASSOC_CHANGE_EV 0x02
109#define SCTP_PEERADDR_CHANGE_EV 0x04
110#define SCTP_SND_FAILED_EV 0x08
111#define SCTP_REMOTE_ERROR_EV 0x10
112#define SCTP_SHUTDOWN_EV 0x20
113#define SCTP_PD_EV 0x40
114#define SCTP_ADAPT_EV 0x80
115
116typedef enum sctp_disposition {
117 SCTP_OK = 1,
118 SCTP_CLOSE,
119} sctp_disposition_t;
120
121extern void send_sctp_stream();
122extern void send_sctp_rr();
123
124extern void recv_sctp_stream();
125extern void recv_sctp_rr();
126
127extern void loc_cpu_rate();
128extern void rem_cpu_rate();