/**
 * rmnet_config_init() - Startup init
 *
 * Registers netlink protocol with kernel and opens socket. Netlink handler is
 * registered with kernel.
 */
int rmnet_config_init(void)
{
	nl_socket_handle = _rmnet_config_start_netlink();
	if (!nl_socket_handle) {
		LOGE("%s(): Failed to init netlink socket", __func__);
		return RMNET_INIT_ERROR;
	}
	return 0;
}
Ejemplo n.º 2
0
/**
 * rmnet_config_init() - Startup init
 *
 * Registers netlink protocol with kernel and opens socket. Netlink handler is
 * registered with kernel.
 */
int rmnet_config_init(void)
{
	int rc;
	nl_socket_handle = _rmnet_config_start_netlink();
	if (!nl_socket_handle) {
		LOGE("%s", "Failed to init netlink socket");
		return RMNET_INIT_ERROR;
	}

	rc = register_netdevice_notifier(&rmnet_dev_notifier);
	if (rc != 0) {
		LOGE("Failed to register device notifier; rc=%d", rc);
		/* TODO: Cleanup the nl socket */
		return RMNET_INIT_ERROR;
	}

	return 0;
}