-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add network configuration API #217
Comments
Created a new network branch to develop this on... |
Proposed API: typedef enum pappl_netconf_e // Network configuration mode
{
PAPPL_NETCONF_OFF, // Turn network interface off
PAPPL_NETCONF_DHCP, // Full DHCP
PAPPL_NETCONF_DHCP_MANUAL, // DHCP with manual IP address
PAPPL_NETCONF_MANUAL // Manual IP, netmask, and router
} pappl_netconf_t;
typedef struct pappl_network_s // Network interface information
{
char name[64]; // Interface name
bool up; // Is this interface up (read-only)?
pappl_netconf_t config4; // IPv4 configuration mode
struct sockaddr_in addr4, // IPv4 address
mask4, // IPv4 netmask
router4, // IPv4 router address
dns4[2]; // IPv4 DNS addresses
pappl_netconf_t config6; // IPv6 configuration mode
struct sockaddr_in6 linkaddr6, // IPv6 link-local address (read-only)
addr6, // IPv6 address
mask6, // IPv6 netmask
router6, // IPv6 router address
dns6[2]; // IPv6 DNS addresses
} pappl_network_t;
// Get networks callback
typedef size_t (*pappl_network_get_cb_t)(pappl_system_t *system, void *cb_data, size_t max_networks, pappl_network_t *networks);
// Set networks callback
typedef bool (*pappl_network_set_cb_t)(pappl_system_t *system, void *cb_data, size_t num_networks, pappl_network_t *networks);
// Set network callbacks
extern void papplSystemSetNetworkCallbacks(pappl_system_t *system, pappl_network_get_cb_t get_cb, pappl_network_set_cb_t set_cb, void *cb_data) _PAPPL_PUBLIC; |
michaelrsweet
added a commit
that referenced
this issue
Aug 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some users of PAPPL need greater control over the network configuration:
Essentially we should provide a similar level of UI as the macOS Network preference pane.
As for Wi-Fi configuration, there should be a new API for getting and setting the current network configuration since the mechanism varies based on OS/distro.
The text was updated successfully, but these errors were encountered: