summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rmnetctl/cli/rmnetcli.c10
-rw-r--r--rmnetctl/cli/rmnetcli.h2
-rw-r--r--rmnetctl/inc/librmnetctl.h58
-rw-r--r--rmnetctl/inc/librmnetctl_hndl.h2
-rw-r--r--rmnetctl/src/librmnetctl.c46
-rw-r--r--sockev/src/sockev_cli.c3
6 files changed, 77 insertions, 44 deletions
diff --git a/rmnetctl/cli/rmnetcli.c b/rmnetctl/cli/rmnetcli.c
index fdbe3c6..2275ec2 100644
--- a/rmnetctl/cli/rmnetcli.c
+++ b/rmnetctl/cli/rmnetcli.c
@@ -2,7 +2,7 @@
R M N E T C L I . C
-Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -151,17 +151,17 @@ static void rmnet_api_usage(void)
printf(_5TABS" bridged. dev_name");
printf(_5TABS" and egress_dev_name");
printf(_5TABS" cannot be larger");
- printf(_5TABS" than 15 tcharacters");
+ printf(_5TABS" than 15 characters");
printf(_5TABS" Returns the status code\n\n");
printf("rmnetcli unsetlepc <logical_ep_id> Un-sets the logical");
printf(_2TABS" <dev_name> endpoint configuration for");
printf(_5TABS" a particular link.");
printf(_5TABS" integers from -1 to 31.");
printf(_5TABS" dev_name cannot be larger");
- printf(_5TABS" than 15 tcharacters");
+ printf(_5TABS" than 15 characters");
printf(_5TABS" Returns the status code\n\n");
printf("rmnetcli getlepc <logical_ep_id> Sets the logical");
- printf(_2TABS" <dev_name> enpoint configuration for a");
+ printf(_2TABS" <dev_name> endpoint configuration for a");
printf(_5TABS" particular link.");
printf(_5TABS" logical_ep_id are 32bit");
printf(_5TABS" integers from -1 to 31.");
@@ -241,7 +241,7 @@ static void print_rmnet_api_status(int return_code, uint16_t error_number)
/*!
* @brief Method to make the API calls
* @details Checks for each type of parameter and calls the appropriate
-* function based on the number of parameters and paramter type
+* function based on the number of parameters and parameter type
* @param argc Number of arguments which vary based on the commands
* @param argv Value of the arguments which vary based on the commands
* @return RMNETCTL_SUCCESS if successful. Relevant data might be printed
diff --git a/rmnetctl/cli/rmnetcli.h b/rmnetctl/cli/rmnetcli.h
index 503a86e..6375082 100644
--- a/rmnetctl/cli/rmnetcli.h
+++ b/rmnetctl/cli/rmnetcli.h
@@ -2,7 +2,7 @@
R M N E T C L I . H
-Copyright (c) 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2013, 2015 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff --git a/rmnetctl/inc/librmnetctl.h b/rmnetctl/inc/librmnetctl.h
index 1b8e985..ff78011 100644
--- a/rmnetctl/inc/librmnetctl.h
+++ b/rmnetctl/inc/librmnetctl.h
@@ -2,7 +2,7 @@
L I B R M N E T C T L . H
-Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -65,69 +65,69 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
enum rmnetctl_error_codes_e {
/* API succeeded. This should always be the first element. */
- RMNETCTL_API_SUCCESS,
+ RMNETCTL_API_SUCCESS = 0,
- RMNETCTL_API_FIRST_ERR,
+ RMNETCTL_API_FIRST_ERR = 1,
/* API failed because not enough memory to create buffer to send
* message */
RMNETCTL_API_ERR_REQUEST_INVALID = RMNETCTL_API_FIRST_ERR,
/* API failed because not enough memory to create buffer for the
* response message */
- RMNETCTL_API_ERR_RESPONSE_INVALID,
+ RMNETCTL_API_ERR_RESPONSE_INVALID = 2,
/* API failed because could not send the message to kernel */
- RMNETCTL_API_ERR_MESSAGE_SEND,
+ RMNETCTL_API_ERR_MESSAGE_SEND = 3,
/* API failed because could not receive message from the kernel */
- RMNETCTL_API_ERR_MESSAGE_RECEIVE,
+ RMNETCTL_API_ERR_MESSAGE_RECEIVE = 4,
- RMNETCTL_INIT_FIRST_ERR,
+ RMNETCTL_INIT_FIRST_ERR = 5,
/* Invalid process id. So return an error. */
RMNETCTL_INIT_ERR_PROCESS_ID = RMNETCTL_INIT_FIRST_ERR,
/* Invalid socket descriptor id. So return an error. */
- RMNETCTL_INIT_ERR_NETLINK_FD,
+ RMNETCTL_INIT_ERR_NETLINK_FD = 6,
/* Could not bind the socket to the Netlink file descriptor */
- RMNETCTL_INIT_ERR_BIND,
+ RMNETCTL_INIT_ERR_BIND = 7,
/* Invalid user id. Only root has access to this function. (NA) */
- RMNETCTL_INIT_ERR_INVALID_USER,
+ RMNETCTL_INIT_ERR_INVALID_USER = 8,
- RMNETCTL_API_SECOND_ERR,
+ RMNETCTL_API_SECOND_ERR = 9,
/* API failed because the RmNet handle for the transaction was NULL */
RMNETCTL_API_ERR_HNDL_INVALID = RMNETCTL_API_SECOND_ERR,
/* API failed because the request buffer for the transaction was NULL */
- RMNETCTL_API_ERR_REQUEST_NULL,
+ RMNETCTL_API_ERR_REQUEST_NULL = 10,
/* API failed because the response buffer for the transaction was NULL*/
- RMNETCTL_API_ERR_RESPONSE_NULL,
+ RMNETCTL_API_ERR_RESPONSE_NULL = 11,
/* API failed because the request and response type do not match*/
- RMNETCTL_API_ERR_MESSAGE_TYPE,
+ RMNETCTL_API_ERR_MESSAGE_TYPE = 12,
/* API failed because the return type is invalid */
- RMNETCTL_API_ERR_RETURN_TYPE,
+ RMNETCTL_API_ERR_RETURN_TYPE = 13,
/* API failed because the string was truncated */
- RMNETCTL_API_ERR_STRING_TRUNCATION,
+ RMNETCTL_API_ERR_STRING_TRUNCATION = 14,
/* These error are 1-to-1 with rmnet_data config errors in rmnet_data.h
for each conversion.
please keep the enums synced.
*/
- RMNETCTL_KERNEL_FIRST_ERR,
+ RMNETCTL_KERNEL_FIRST_ERR = 15,
/* No error */
RMNETCTL_KERNEL_ERROR_NO_ERR = RMNETCTL_KERNEL_FIRST_ERR,
/* Invalid / unsupported message */
- RMNETCTL_KERNEL_ERR_UNKNOWN_MESSAGE,
- /* Internal problem in the kernel modeule */
- RMNETCTL_KERNEL_ERR_INTERNAL,
- /* Kernel is temporarely out of memory */
- RMNETCTL_KERNEL_ERR_OUT_OF_MEM,
+ RMNETCTL_KERNEL_ERR_UNKNOWN_MESSAGE = 16,
+ /* Internal problem in the kernel module */
+ RMNETCTL_KERNEL_ERR_INTERNAL = 17,
+ /* Kernel is temporarily out of memory */
+ RMNETCTL_KERNEL_ERR_OUT_OF_MEM = 18,
/* Device already exists / Still in use */
- RMETNCTL_KERNEL_ERR_DEVICE_IN_USE,
+ RMETNCTL_KERNEL_ERR_DEVICE_IN_USE = 19,
/* Invalid request / Unsupported scenario */
- RMNETCTL_KERNEL_ERR_INVALID_REQUEST,
+ RMNETCTL_KERNEL_ERR_INVALID_REQUEST = 20,
/* Device doesn't exist */
- RMNETCTL_KERNEL_ERR_NO_SUCH_DEVICE,
+ RMNETCTL_KERNEL_ERR_NO_SUCH_DEVICE = 21,
/* One or more of the arguments is invalid */
- RMNETCTL_KERNEL_ERR_BAD_ARGS,
+ RMNETCTL_KERNEL_ERR_BAD_ARGS = 22,
/* Egress device is invalid */
- RMNETCTL_KERNEL_ERR_BAD_EGRESS_DEVICE,
+ RMNETCTL_KERNEL_ERR_BAD_EGRESS_DEVICE = 23,
/* TC handle is full */
- RMNETCTL_KERNEL_ERR_TC_HANDLE_FULL,
+ RMNETCTL_KERNEL_ERR_TC_HANDLE_FULL = 24,
/* This should always be the last element */
RMNETCTL_API_ERR_ENUM_LENGTH
@@ -159,7 +159,7 @@ char rmnetctl_error_code_text
"ERROR: Kernel call succeeded\n",
"ERROR: Invalid / Unsupported directive\n",
"ERROR: Internal problem in the kernel module\n",
- "ERROR: The kernel is temporarely out of memory\n",
+ "ERROR: The kernel is temporarily out of memory\n",
"ERROR: Device already exists / Still in use\n",
"ERROR: Invalid request / Unsupported scenario\n",
"ERROR: Device doesn't exist\n",
diff --git a/rmnetctl/inc/librmnetctl_hndl.h b/rmnetctl/inc/librmnetctl_hndl.h
index c020e7b..1a435ed 100644
--- a/rmnetctl/inc/librmnetctl_hndl.h
+++ b/rmnetctl/inc/librmnetctl_hndl.h
@@ -2,7 +2,7 @@
L I B R M N E T C T L _ H N D L. H
-Copyright (c) 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2013, 2015 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff --git a/rmnetctl/src/librmnetctl.c b/rmnetctl/src/librmnetctl.c
index b0f98a7..749e346 100644
--- a/rmnetctl/src/librmnetctl.c
+++ b/rmnetctl/src/librmnetctl.c
@@ -2,7 +2,7 @@
L I B R M N E T C T L . C
-Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -33,7 +33,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*!
* @file librmnetctl.c
-* @brief rmnet control API's implentations file
+* @brief rmnet control API's implementation file
*/
/*===========================================================================
@@ -438,8 +438,14 @@ int rmnet_get_network_device_associated(rmnetctl_hndl_t *hndl,
!= RMNETCTL_SUCCESS)
break;
- if (_rmnetctl_check_data(response.crd, error_code) != RMNETCTL_SUCCESS)
+ if (_rmnetctl_check_data(response.crd, error_code)
+ != RMNETCTL_SUCCESS) {
+ if (_rmnetctl_check_code(response.crd, error_code)
+ == RMNETCTL_SUCCESS)
+ return_code = _rmnetctl_set_codes(response.return_code,
+ error_code);
break;
+ }
*register_status = response.return_code;
return_code = RMNETCTL_SUCCESS;
@@ -517,8 +523,14 @@ int rmnet_get_link_egress_data_format(rmnetctl_hndl_t *hndl,
!= RMNETCTL_SUCCESS)
break;
- if (_rmnetctl_check_data(response.crd, error_code) != RMNETCTL_SUCCESS)
+ if (_rmnetctl_check_data(response.crd, error_code)
+ != RMNETCTL_SUCCESS) {
+ if (_rmnetctl_check_code(response.crd, error_code)
+ == RMNETCTL_SUCCESS)
+ return_code = _rmnetctl_set_codes(response.return_code,
+ error_code);
break;
+ }
*egress_flags = response.data_format.flags;
*agg_size = response.data_format.agg_size;
@@ -595,8 +607,14 @@ int rmnet_get_link_ingress_data_format_tailspace(rmnetctl_hndl_t *hndl,
!= RMNETCTL_SUCCESS)
break;
- if (_rmnetctl_check_data(response.crd, error_code) != RMNETCTL_SUCCESS)
+ if (_rmnetctl_check_data(response.crd, error_code)
+ != RMNETCTL_SUCCESS) {
+ if (_rmnetctl_check_code(response.crd, error_code)
+ == RMNETCTL_SUCCESS)
+ return_code = _rmnetctl_set_codes(response.return_code,
+ error_code);
break;
+ }
if (ingress_flags)
*ingress_flags = response.data_format.flags;
@@ -727,8 +745,15 @@ int rmnet_get_logical_ep_config(rmnetctl_hndl_t *hndl,
if ((*error_code = rmnetctl_transact(hndl, &request, &response))
!= RMNETCTL_SUCCESS)
break;
- if (_rmnetctl_check_data(response.crd, error_code) != RMNETCTL_SUCCESS)
+
+ if (_rmnetctl_check_data(response.crd, error_code)
+ != RMNETCTL_SUCCESS) {
+ if (_rmnetctl_check_code(response.crd, error_code)
+ == RMNETCTL_SUCCESS)
+ return_code = _rmnetctl_set_codes(response.return_code,
+ error_code);
break;
+ }
str_len = strlcpy(*next_dev,
(char *)(response.local_ep_config.next_dev),
@@ -819,8 +844,15 @@ int rmnet_get_vnd_name(rmnetctl_hndl_t *hndl,
if ((*error_code = rmnetctl_transact(hndl, &request, &response))
!= RMNETCTL_SUCCESS)
break;
- if (_rmnetctl_check_data(response.crd, error_code) != RMNETCTL_SUCCESS)
+
+ if (_rmnetctl_check_data(response.crd, error_code)
+ != RMNETCTL_SUCCESS) {
+ if (_rmnetctl_check_code(response.crd, error_code)
+ == RMNETCTL_SUCCESS)
+ return_code = _rmnetctl_set_codes(response.return_code,
+ error_code);
break;
+ }
str_len = (uint32_t)strlcpy(buf,
(char *)(response.vnd.vnd_name),
diff --git a/sockev/src/sockev_cli.c b/sockev/src/sockev_cli.c
index c007767..21d6c62 100644
--- a/sockev/src/sockev_cli.c
+++ b/sockev/src/sockev_cli.c
@@ -43,7 +43,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
int main(void)
{
- int skfd, addrlen, rc;
+ int skfd, rc;
+ socklen_t addrlen;
struct sockaddr_nl my_addr, src_addr;
struct nlmsghdr *nlh = NULL;
struct sknlsockevmsg *msg;