Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mdmngr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IOPSYS
mdmngr
Commits
4de59035
Commit
4de59035
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
small change to output format
parent
a928df73
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libmobile.c
+32
-30
32 additions, 30 deletions
libmobile.c
with
32 additions
and
30 deletions
libmobile.c
+
32
−
30
View file @
4de59035
...
@@ -179,6 +179,34 @@ static char *lexer(char **input, char *delimiter) {
...
@@ -179,6 +179,34 @@ static char *lexer(char **input, char *delimiter) {
return
substr
;
return
substr
;
}
}
/**
* Function: get_query_wrapper
* Wraps the input comma-separated values to the appropriate address format for a GET request.
*
* Parameters:
* vars - Char pointer pointing to comma-separated values to retreive.
*
* Returns:
* The entire query on success.
* NULL on failure.
*/
static
char
*
get_query_wrapper
(
char
*
vars
)
{
if
(
strlen
(
vars
)
==
0
)
{
printf
(
"No GET input provided!
\n
"
);
return
NULL
;
}
char
query
[
1024
]
=
{
0
};
strncpy
(
query
,
"http://192.168.0.1/goform/goform_get_cmd_process?isTest=false&cmd="
,
1023
);
strncat
(
query
+
strlen
(
query
),
vars
,
1023
);
strncat
(
query
+
strlen
(
query
),
"&multi_data=1"
,
1023
);
return
strdup
(
query
);
}
struct
json_object
*
parse_apn_profiles
(
char
*
apn_profiles
)
struct
json_object
*
parse_apn_profiles
(
char
*
apn_profiles
)
{
{
if
(
strlen
(
apn_profiles
)
<=
0
)
{
if
(
strlen
(
apn_profiles
)
<=
0
)
{
...
@@ -210,8 +238,10 @@ struct json_object *parse_apn_profiles(char *apn_profiles)
...
@@ -210,8 +238,10 @@ struct json_object *parse_apn_profiles(char *apn_profiles)
i
++
;
i
++
;
free
(
field_val
);
free
(
field_val
);
}
}
char
name
[
1024
];
char
name
[
1024
]
=
{
0
};
sprintf
(
name
,
"%d"
,
apn_counter
);
strncpy
(
name
,
"apn_config_"
,
1023
);
sprintf
(
name
+
strlen
(
name
),
"%d"
,
apn_counter
);
json_object_object_add
(
parsed_profiles
,
name
,
json_object_get
(
apn_profile
));
json_object_object_add
(
parsed_profiles
,
name
,
json_object_get
(
apn_profile
));
json_object_put
(
apn_profile
);
json_object_put
(
apn_profile
);
apn_counter
++
;
apn_counter
++
;
...
@@ -224,7 +254,6 @@ free_objects:
...
@@ -224,7 +254,6 @@ free_objects:
fail:
fail:
return
NULL
;
return
NULL
;
finished:
finished:
//best guess, free: apn_profiles_json
json_object_put
(
apn_profiles_json
);
json_object_put
(
apn_profiles_json
);
return
parsed_profiles
;
return
parsed_profiles
;
}
}
...
@@ -439,33 +468,6 @@ fail:
...
@@ -439,33 +468,6 @@ fail:
return
NULL
;
return
NULL
;
}
}
/**
* Function: get_query_wrapper
* Wraps the input comma-separated values to the appropriate address format for a GET request.
*
* Parameters:
* vars - Char pointer pointing to comma-separated values to retreive.
*
* Returns:
* The entire query on success.
* NULL on failure.
*/
char
*
get_query_wrapper
(
char
*
vars
)
{
if
(
strlen
(
vars
)
==
0
)
{
printf
(
"No GET input provided!
\n
"
);
return
NULL
;
}
char
query
[
1024
]
=
{
0
};
strncpy
(
query
,
"http://192.168.0.1/goform/goform_get_cmd_process?isTest=false&cmd="
,
1023
);
strncat
(
query
+
strlen
(
query
),
vars
,
1023
);
strncat
(
query
+
strlen
(
query
),
"&multi_data=1"
,
1023
);
return
strdup
(
query
);
}
char
*
mobile_get_request
(
char
*
vars
)
char
*
mobile_get_request
(
char
*
vars
)
{
{
CURL
*
curl
;
CURL
*
curl
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment