1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

network: s/user_data/userdata/

Everywhere else we call the generic user data pointer just "userdata",
rather than "user_data". Let's do this here, too.
This commit is contained in:
Lennart Poettering 2015-08-26 22:47:53 +02:00
parent 0ae0e5cd96
commit 89ca10c6a6
7 changed files with 17 additions and 17 deletions

View File

@ -45,10 +45,10 @@ int dhcp_option_append(DHCPMessage *message, size_t size, size_t *offset, uint8_
uint8_t code, size_t optlen, const void *optval);
typedef int (*dhcp_option_cb_t)(uint8_t code, uint8_t len,
const uint8_t *option, void *user_data);
const uint8_t *option, void *userdata);
int dhcp_option_parse(DHCPMessage *message, size_t len,
dhcp_option_cb_t cb, void *user_data);
dhcp_option_cb_t cb, void *userdata);
int dhcp_message_init(DHCPMessage *message, uint8_t op, uint32_t xid,
uint8_t type, uint16_t arp_type, size_t optlen,

View File

@ -88,7 +88,7 @@ struct sd_dhcp_lease {
int dhcp_lease_new(sd_dhcp_lease **ret);
int dhcp_lease_parse_options(uint8_t code, uint8_t len, const uint8_t *option,
void *user_data);
void *userdata);
int dhcp_lease_insert_private_option(sd_dhcp_lease *lease, uint8_t tag,
const uint8_t *data, uint8_t len);

View File

@ -140,7 +140,7 @@ int dhcp_option_append(DHCPMessage *message, size_t size, size_t *offset,
static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overload,
uint8_t *message_type, dhcp_option_cb_t cb,
void *user_data) {
void *userdata) {
uint8_t code, len;
size_t offset = 0;
@ -199,7 +199,7 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo
return -EINVAL;
if (cb)
cb(code, len, &options[offset], user_data);
cb(code, len, &options[offset], userdata);
offset += len;
@ -214,7 +214,7 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo
}
int dhcp_option_parse(DHCPMessage *message, size_t len,
dhcp_option_cb_t cb, void *user_data) {
dhcp_option_cb_t cb, void *userdata) {
uint8_t overload = 0;
uint8_t message_type = 0;
int r;
@ -228,20 +228,20 @@ int dhcp_option_parse(DHCPMessage *message, size_t len,
len -= sizeof(DHCPMessage);
r = parse_options(message->options, len, &overload, &message_type,
cb, user_data);
cb, userdata);
if (r < 0)
return r;
if (overload & DHCP_OVERLOAD_FILE) {
r = parse_options(message->file, sizeof(message->file),
NULL, &message_type, cb, user_data);
NULL, &message_type, cb, userdata);
if (r < 0)
return r;
}
if (overload & DHCP_OVERLOAD_SNAME) {
r = parse_options(message->sname, sizeof(message->sname),
NULL, &message_type, cb, user_data);
NULL, &message_type, cb, userdata);
if (r < 0)
return r;
}

View File

@ -551,8 +551,8 @@ static int server_send_forcerenew(sd_dhcp_server *server, be32_t address,
}
static int parse_request(uint8_t code, uint8_t len, const uint8_t *option,
void *user_data) {
DHCPRequest *req = user_data;
void *userdata) {
DHCPRequest *req = userdata;
assert(req);

View File

@ -127,7 +127,7 @@ static void test_checksum(void)
}
static int check_options(uint8_t code, uint8_t len, const uint8_t *option,
void *user_data)
void *userdata)
{
switch(code) {
case DHCP_OPTION_CLIENT_IDENTIFIER:

View File

@ -145,8 +145,8 @@ static void test_ignore_opts(uint8_t *descoption, int *descpos, int *desclen) {
}
}
static int test_options_cb(uint8_t code, uint8_t len, const uint8_t *option, void *user_data) {
struct option_desc *desc = user_data;
static int test_options_cb(uint8_t code, uint8_t len, const uint8_t *option, void *userdata) {
struct option_desc *desc = userdata;
uint8_t *descoption = NULL;
int *desclen = NULL, *descpos = NULL;
uint8_t optcode = 0;

View File

@ -39,9 +39,9 @@ static int test_fd[2];
static int basic_request_handler_bind = 0;
static int basic_request_handler_stop = 0;
static void* basic_request_handler_user_data = (void*)0xCABCAB;
static void* basic_request_handler_userdata = (void*)0xCABCAB;
static void basic_request_handler(sd_ipv4ll *ll, int event, void *userdata) {
assert_se(userdata == basic_request_handler_user_data);
assert_se(userdata == basic_request_handler_userdata);
switch(event) {
case IPV4LL_EVENT_STOP:
@ -175,7 +175,7 @@ static void test_basic_request(sd_event *e) {
assert_se(sd_ipv4ll_start(ll) == -EINVAL);
assert_se(sd_ipv4ll_set_callback(ll, basic_request_handler,
basic_request_handler_user_data) == 0);
basic_request_handler_userdata) == 0);
assert_se(sd_ipv4ll_start(ll) == -EINVAL);
assert_se(sd_ipv4ll_set_index(ll, 1) == 0);