This repository has been archived by the owner on Dec 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: Rename IPC functions to reduce misleading
The function name like ipc_get_device() is a little bit misleading. To make the code more readable for new developers, here are some suggestions: * Rename ipc_get_device(&dev) to ipc_fetch_conf(&conf) because it only fetches the runtime configuations from kernel. * Funtion prototype ipc_set_device(struct wgdevice *dev) is changed to ipc_set_device(const struct wgdevice *newconf). Change the following IPC function names and parameters which used to be confusing: * ipc_set_device(dev) => ipc_set_device(newconf) * ipc_get_device(dev, interface) => ipc_fetch_conf(conf, interface) * kernel_set_device(dev) => kernel_set_device(newconf) * kernel_get_device(device, interface) => kernel_fetch_conf(conf, interface) * userspace_set_device(dev) => userspace_set_device(newconf) * userspace_get_device(out, interface) => userspace_fetch_conf(out, interface) Renamed local variable/parameter symbols: * In showconf_main(), show_main(): device => conf * In ipc_fetch_conf(), kernel_fetch_conf(), userspace_fetch_conf(): dev => conf * In ipc_set_device(), kernel_set_device(), userspace_set_device(): dev => newconf Added function: * free_conf(struct wgdevice *conf) Changed function prototypes: * int ipc_set_device(struct wgdevice *) => int ipc_set_device(const struct wgdevice *newconf) * int kernel_set_device(struct wgdevice *) => int kernel_set_device(const struct wgdevice *newconf) * int userspace_set_device(struct wgdevice *) => int userspace_set_device(const struct wgdevice *newconf) Note: This patch comes with no extra curly braces introduced. Signed-off-by: Liu Qun <[email protected]>
- Loading branch information
Showing
4 changed files
with
111 additions
and
78 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
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.