Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
libdvbpsi
Commits
37465c76
Commit
37465c76
authored
Sep 17, 2012
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvbinfo: add commandline options for selecting a multicast interface.
parent
4da7ecbf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
examples/dvbinfo/dvbinfo.c
examples/dvbinfo/dvbinfo.c
+18
-3
examples/dvbinfo/dvbinfo.h
examples/dvbinfo/dvbinfo.h
+3
-0
No files found.
examples/dvbinfo/dvbinfo.c
View file @
37465c76
...
...
@@ -94,7 +94,7 @@ typedef struct dvbinfo_capture_s
static
void
usage
(
void
)
{
#ifdef HAVE_SYS_SOCKET_H
printf
(
"Usage: dvbinfo [-h] [-d <debug>] [-f|-m| [[-u|-t] -i <ipaddress:port>] -o <outputfile>
\n
"
);
printf
(
"Usage: dvbinfo [-h] [-d <debug>] [-f|-m| [[-u|-t] -
a <mcast_interface> -
i <ipaddress:port>] -o <outputfile>
\n
"
);
printf
(
" [-s [bandwidth|table|packet] --summary-file <file> --summary-period <ms>]
\n
"
);
#else
printf
(
"Usage: dvbinfo [-h] [-d <debug>] [-f|
\n
"
);
...
...
@@ -106,6 +106,7 @@ static void usage(void)
printf
(
" -f | --file : filename
\n
"
);
#ifdef HAVE_SYS_SOCKET_H
printf
(
" -i | --ipadddress : hostname or ipaddress
\n
"
);
printf
(
" -a | --miface : multicast interface to use
\n
"
);
printf
(
" -t | --tcp : tcp network transport
\n
"
);
printf
(
" -u | --udp : udp network transport
\n
"
);
printf
(
"
\n
Outputs:
\n
"
);
...
...
@@ -171,6 +172,7 @@ static params_t *params_init(void)
param
->
fd_in
=
param
->
fd_out
=
-
1
;
param
->
input
=
NULL
;
param
->
output
=
NULL
;
param
->
mcast_interface
=
NULL
;
param
->
b_verbose
=
false
;
param
->
b_monitor
=
false
;
...
...
@@ -190,6 +192,7 @@ static params_t *params_init(void)
static
void
params_free
(
params_t
*
param
)
{
free
(
param
->
mcast_interface
);
free
(
param
->
input
);
free
(
param
->
output
);
free
(
param
->
summary
.
file
);
...
...
@@ -223,7 +226,7 @@ static void dvbinfo_open(params_t *param)
}
if
(
param
->
input
&&
param
->
b_udp
)
{
param
->
fd_in
=
udp_open
(
param
->
input
,
param
->
port
);
param
->
fd_in
=
udp_open
(
param
->
mcast_interface
,
param
->
input
,
param
->
port
);
if
(
param
->
fd_in
<
0
)
goto
error
;
}
...
...
@@ -457,6 +460,7 @@ int main(int argc, char **pp_argv)
{
"file"
,
required_argument
,
NULL
,
'f'
},
#ifdef HAVE_SYS_SOCKET_H
{
"ipaddress"
,
required_argument
,
NULL
,
'i'
},
{
"miface"
,
required_argument
,
NULL
,
'a'
},
{
"tcp"
,
no_argument
,
NULL
,
't'
},
{
"udp"
,
no_argument
,
NULL
,
'u'
},
/* - outputs - */
...
...
@@ -471,7 +475,7 @@ int main(int argc, char **pp_argv)
{
NULL
,
0
,
NULL
,
0
}
};
#ifdef HAVE_SYS_SOCKET_H
while
((
c
=
getopt_long
(
argc
,
pp_argv
,
"d:f:i:ho:ms:tu"
,
long_options
,
NULL
))
!=
-
1
)
while
((
c
=
getopt_long
(
argc
,
pp_argv
,
"
a:
d:f:i:ho:ms:tu"
,
long_options
,
NULL
))
!=
-
1
)
#else
while
((
c
=
getopt_long
(
argc
,
pp_argv
,
"d:f:h"
,
long_options
,
NULL
))
!=
-
1
)
#endif
...
...
@@ -507,6 +511,17 @@ int main(int argc, char **pp_argv)
break
;
#ifdef HAVE_SYS_SOCKET_H
case
'a'
:
{
if
(
optarg
)
{
if
(
asprintf
(
&
param
->
mcast_interface
,
"%s"
,
optarg
)
<
0
)
{
params_free
(
param
);
usage
();
}
}
}
case
'i'
:
if
(
optarg
)
{
...
...
examples/dvbinfo/dvbinfo.h
View file @
37465c76
...
...
@@ -37,7 +37,10 @@ typedef struct params_s
/* parameters */
char
*
output
;
char
*
input
;
int
port
;
char
*
mcast_interface
;
bool
b_udp
;
bool
b_tcp
;
bool
b_file
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment