Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28896 from pelaufer/dhcp_dbus_notify
Add DHCP client state and change notification to networkd dbus interface
- Loading branch information
Showing
20 changed files
with
402 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
/* SPDX-License-Identifier: LGPL-2.1-or-later */ | ||
#pragma once | ||
|
||
#include "sd-dhcp-client.h" | ||
|
||
extern const struct hash_ops dhcp_option_hash_ops; | ||
|
||
int dhcp_client_set_state_callback( | ||
sd_dhcp_client *client, | ||
sd_dhcp_client_callback_t cb, | ||
void *userdata); | ||
int dhcp_client_get_state(sd_dhcp_client *client); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* SPDX-License-Identifier: LGPL-2.1-or-later */ | ||
|
||
#include "dhcp-protocol.h" | ||
#include "string-table.h" | ||
|
||
static const char* const dhcp_state_table[_DHCP_STATE_MAX] = { | ||
[DHCP_STATE_STOPPED] = "stopped", | ||
[DHCP_STATE_INIT] = "initialization", | ||
[DHCP_STATE_SELECTING] = "selecting", | ||
[DHCP_STATE_INIT_REBOOT] = "init-reboot", | ||
[DHCP_STATE_REBOOTING] = "rebooting", | ||
[DHCP_STATE_REQUESTING] = "requesting", | ||
[DHCP_STATE_BOUND] = "bound", | ||
[DHCP_STATE_RENEWING] = "renewing", | ||
[DHCP_STATE_REBINDING] = "rebinding", | ||
}; | ||
|
||
DEFINE_STRING_TABLE_LOOKUP_TO_STRING(dhcp_state, DHCPState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* SPDX-License-Identifier: LGPL-2.1-or-later */ | ||
#pragma once | ||
|
||
#include "sd-dhcp6-client.h" | ||
|
||
int dhcp6_client_set_state_callback( | ||
sd_dhcp6_client *client, | ||
sd_dhcp6_client_callback_t cb, | ||
void *userdata); | ||
int dhcp6_client_get_state(sd_dhcp6_client *client); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.