Skip to content

Commit 7f29a38

Browse files
committed
net-test: packetdrill: rename WIRE_IP_ADDR to WIRE_LIVE_LOCAL_IP
In preparation for having the client send the live_remote_ip_string to the wire server, rename WIRE_IP_ADDR to WIRE_LIVE_LOCAL_IP to avoid confusion. Signed-off-by: Neal Cardwell <[email protected]> Change-Id: I6a981cf13138fc597c88f8f621929a8b2436f328
1 parent 2bddd52 commit 7f29a38

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

gtests/net/packetdrill/wire_client.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,16 @@ static void wire_client_send_hw_address(struct wire_client *wire_client,
139139
"error sending WIRE_HARDWARE_ADDR");
140140
}
141141

142-
/* Send the IP address to which the server should send packets. */
143-
static void wire_client_send_ip_address(struct wire_client *wire_client,
144-
const struct config *config)
142+
/* Send the IP live_local address to which the server should send packets. */
143+
static void wire_client_send_live_local_ip(struct wire_client *wire_client,
144+
const struct config *config)
145145
{
146146
if (wire_conn_write(wire_client->wire_conn,
147-
WIRE_IP_ADDR,
147+
WIRE_LIVE_LOCAL_IP,
148148
config->live_local_ip_string,
149149
strlen(config->live_local_ip_string)))
150150
wire_client_die(wire_client,
151-
"error sending WIRE_IP_ADDR");
151+
"error sending WIRE_LIVE_LOCAL_IP");
152152
}
153153

154154
/* Receive server's message that the server is ready to execute the script. */
@@ -277,7 +277,7 @@ int wire_client_init(struct wire_client *wire_client,
277277

278278
wire_client_send_hw_address(wire_client, config);
279279

280-
wire_client_send_ip_address(wire_client, config);
280+
wire_client_send_live_local_ip(wire_client, config);
281281

282282
wire_client_receive_server_ready(wire_client);
283283

gtests/net/packetdrill/wire_protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const char *wire_op_to_string(enum wire_op_t op)
3636
case WIRE_SCRIPT_PATH: return "WIRE_SCRIPT_PATH";
3737
case WIRE_SCRIPT: return "WIRE_SCRIPT";
3838
case WIRE_HARDWARE_ADDR: return "WIRE_HARDWARE_ADDR";
39-
case WIRE_IP_ADDR: return "WIRE_IP_ADDR";
39+
case WIRE_LIVE_LOCAL_IP: return "WIRE_LIVE_LOCAL_IP";
4040
case WIRE_SERVER_READY: return "WIRE_SERVER_READY";
4141
case WIRE_CLIENT_STARTING: return "WIRE_CLIENT_STARTING";
4242
case WIRE_PACKETS_START: return "WIRE_PACKETS_START";

gtests/net/packetdrill/wire_protocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ enum wire_op_t {
3434
WIRE_SCRIPT_PATH, /* "here's the path of the script" */
3535
WIRE_SCRIPT, /* "here's the script we're going to start" */
3636
WIRE_HARDWARE_ADDR, /* "here's my ethernet MAC address" */
37-
WIRE_IP_ADDR, /* "here's the client live_local_ip_string */
37+
WIRE_LIVE_LOCAL_IP, /* "here's the client live_local_ip_string */
3838
WIRE_SERVER_READY, /* "server ready to start script execution" */
3939
WIRE_CLIENT_STARTING, /* "i'm starting script execution... now!" */
4040
WIRE_PACKETS_START, /* "please start handling packet events" */

gtests/net/packetdrill/wire_server.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ static int wire_server_receive_hw_address(struct wire_server *wire_server)
207207
return STATUS_OK;
208208
}
209209

210-
/* Receive the IP address to which the server should send packets. */
211-
static int wire_server_receive_ip_address(struct wire_server *wire_server)
210+
/* Receive the live_local IP address to which the server should send packets. */
211+
static int wire_server_receive_live_local_ip(struct wire_server *wire_server)
212212
{
213213
enum wire_op_t op = WIRE_INVALID;
214214
void *buf = NULL;
@@ -217,9 +217,9 @@ static int wire_server_receive_ip_address(struct wire_server *wire_server)
217217

218218
if (wire_conn_read(wire_server->wire_conn, &op, &buf, &buf_len))
219219
return STATUS_ERR;
220-
if (op != WIRE_IP_ADDR) {
220+
if (op != WIRE_LIVE_LOCAL_IP) {
221221
fprintf(stderr,
222-
"bad wire client: expected WIRE_IP_ADDR\n");
222+
"bad wire client: expected WIRE_LIVE_LOCAL_IP\n");
223223
return STATUS_ERR;
224224
}
225225
if (buf_len + 1 > sizeof(config->live_local_ip_string)) {
@@ -230,7 +230,8 @@ static int wire_server_receive_ip_address(struct wire_server *wire_server)
230230

231231
memcpy(config->live_local_ip_string, buf, buf_len);
232232
config->live_local_ip_string[buf_len] = '\0'; /* NULL-terminate str */
233-
DEBUGP("got WIRE_IP_ADDR: [%s]\n", config->live_local_ip_string);
233+
DEBUGP("got WIRE_LIVE_LOCAL_IP: [%s]\n",
234+
config->live_local_ip_string);
234235

235236
return STATUS_OK;
236237
}
@@ -484,7 +485,7 @@ static void *wire_server_thread(void *arg)
484485
if (wire_server_receive_hw_address(wire_server))
485486
goto error_done;
486487

487-
if (wire_server_receive_ip_address(wire_server))
488+
if (wire_server_receive_live_local_ip(wire_server))
488489
goto error_done;
489490

490491
if (parse_script_and_set_config(wire_server->argc,

0 commit comments

Comments
 (0)