Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
packages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Firmware
packages
Commits
5ebf5c62
Commit
5ebf5c62
authored
9 years ago
by
Johannes Rudolph
Browse files
Options
Downloads
Patches
Plain Diff
make new function getBssid
parent
ed3a77c0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
Skip Mesh BSSID
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libwlocate/src/getbssid.c
+34
-46
34 additions, 46 deletions
libwlocate/src/getbssid.c
with
34 additions
and
46 deletions
libwlocate/src/getbssid.c
+
34
−
46
View file @
5ebf5c62
...
...
@@ -113,54 +113,42 @@ static const char * match_regex (regex_t * r, const char * to_match)
}
return
""
;
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
regex_t
r
;
const
char
*
regex_text
;
const
char
*
result
;
regex_text
=
".*?option bssid '(.*)'"
;
FILE
*
f
=
fopen
(
"/etc/config/wireless"
,
"rb"
);
fseek
(
f
,
0
,
SEEK_END
);
long
fsize
=
ftell
(
f
);
fseek
(
f
,
0
,
SEEK_SET
);
char
*
string
=
malloc
(
fsize
+
1
);
fread
(
string
,
fsize
,
1
,
f
);
fclose
(
f
);
string
[
fsize
]
=
0
;
//printf("%s",string);
compile_regex
(
&
r
,
regex_text
);
int
*
getMeshBssid
(){
printf
(
"####"
);
static
int
bssid
[
8
];
printf
(
"####"
);
regex_t
r
;
const
char
*
regex_text
;
const
char
*
result
;
regex_text
=
".*?option bssid '(.*)'"
;
FILE
*
f
=
fopen
(
"/etc/config/wireless"
,
"rb"
);
fseek
(
f
,
0
,
SEEK_END
);
long
fsize
=
ftell
(
f
);
fseek
(
f
,
0
,
SEEK_SET
);
char
*
string
=
malloc
(
fsize
+
1
);
fread
(
string
,
fsize
,
1
,
f
);
fclose
(
f
);
string
[
fsize
]
=
0
;
printf
(
"####"
);
printf
(
"%s"
,
string
);
compile_regex
(
&
r
,
regex_text
);
result
=
match_regex
(
&
r
,
string
);
regfree
(
&
r
);
printf
(
"
\n
%s
\n
"
,
result
);
/*char ch, file_name[25];
char msgbuf[1000];
FILE *fp;
printf("Read file\n");
fp = fopen("/etc/config/wireless","r"); // read mode
if( fp == NULL )
{
perror("Error while opening the file.\n");
exit(EXIT_FAILURE);
}
pintf
(
"
\n
%s
\n
"
,
result
);
return
bssid
;
}
while( ( ch = fgetc(fp) ) != EOF
)
printf("%c",ch);
fclose(fp
);
return 0;*/
int
main
(
int
argc
,
const
char
*
argv
[]
)
{
printf
(
"####"
);
getMeshBssid
(
);
}
\ No newline at end of file
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