Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
vlc
Commits
d072e40d
Commit
d072e40d
authored
May 02, 2001
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* FreeBSD CSS decryption support.
parent
5e0ca682
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
263 additions
and
84 deletions
+263
-84
ChangeLog
ChangeLog
+1
-0
configure
configure
+71
-28
configure.in
configure.in
+28
-3
include/defs.h.in
include/defs.h.in
+17
-2
plugins/dvd/dvd_css.c
plugins/dvd/dvd_css.c
+13
-13
plugins/dvd/dvd_ioctl.c
plugins/dvd/dvd_ioctl.c
+126
-31
plugins/dvd/dvd_ioctl.h
plugins/dvd/dvd_ioctl.h
+7
-7
No files found.
ChangeLog
View file @
d072e40d
...
...
@@ -3,6 +3,7 @@
#===================#
HEAD
*
FreeBSD
CSS
decryption
support
.
*
Fixed
a
segfault
in
TS
input
(
psi
packets
with
adaptation
field
).
*
Corrected
vlc
-
howto
.
sgml
thanks
to
Arnaud
Gomes
-
do
-
Vale
<
arnaud
@
carrosse
.
frmug
.
org
>.
...
...
configure
View file @
d072e40d
...
...
@@ -3211,7 +3211,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
EOF
BUILTINS
=
"
${
BUILTINS
}
dvd"
for
ac_hdr
in
linux/cdrom.h
for
ac_hdr
in
sys/cdio.h sys/dvdio.h
linux/cdrom.h
do
ac_safe
=
`
echo
"
$ac_hdr
"
|
sed
'y%./+-%__p_%'
`
echo
$ac_n
"checking for
$ac_hdr
""...
$ac_c
"
1>&6
...
...
@@ -3251,17 +3251,60 @@ else
fi
done
cat
>
conftest.
$ac_ext
<<
EOF
#line 3256 "configure"
BSD_DVD_STRUCT
=
0
cat
>
conftest.
$ac_ext
<<
EOF
#line 3257 "configure"
#include "confdefs.h"
#include <sys/dvdio.h>
EOF
if
(
eval
"
$ac_cpp
conftest.
$ac_ext
"
)
2>&5 |
egrep
"dvd_struct"
>
/dev/null 2>&1
;
then
rm
-rf
conftest
*
cat
>>
confdefs.h
<<
\
EOF
#define DVD_STRUCT_IN_SYS_DVDIO_H 1
EOF
BSD_DVD_STRUCT
=
1
fi
rm
-f
conftest
*
cat
>
conftest.
$ac_ext
<<
EOF
#line 3275 "configure"
#include "confdefs.h"
#include <sys/cdio.h>
EOF
if
(
eval
"
$ac_cpp
conftest.
$ac_ext
"
)
2>&5 |
egrep
"dvd_struct"
>
/dev/null 2>&1
;
then
rm
-rf
conftest
*
cat
>>
confdefs.h
<<
\
EOF
#define DVD_STRUCT_IN_SYS_CDIO_H 1
EOF
BSD_DVD_STRUCT
=
1
fi
rm
-f
conftest
*
if
test
x
$BSD_DVD_STRUCT
=
x1
;
then
cat
>>
confdefs.h
<<
\
EOF
#define HAVE_BSD_DVD_STRUCT 1
EOF
fi
cat
>
conftest.
$ac_ext
<<
EOF
#line 3299 "configure"
#include "confdefs.h"
#include <linux/cdrom.h>
EOF
if
(
eval
"
$ac_cpp
conftest.
$ac_ext
"
)
2>&5 |
egrep
"dvd"
>
/dev/null 2>&1
;
then
egrep
"dvd
_struct
"
>
/dev/null 2>&1
;
then
rm
-rf
conftest
*
cat
>>
confdefs.h
<<
\
EOF
#define
LINUX_DVD
1
#define
DVD_STRUCT_IN_LINUX_CDROM_H
1
EOF
...
...
@@ -3403,7 +3446,7 @@ if test "${enable_esd+set}" = set; then
# Extract the first word of "esd-config", so it can be a program name with args.
set
dummy esd-config
;
ac_word
=
$2
echo
$ac_n
"checking for
$ac_word
""...
$ac_c
"
1>&6
echo
"configure:34
07
: checking for
$ac_word
"
>
&5
echo
"configure:34
50
: checking for
$ac_word
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_path_ESD_CONFIG
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
...
...
@@ -3468,17 +3511,17 @@ else
do
ac_safe
=
`
echo
"
$ac_hdr
"
|
sed
'y%./+-%__p_%'
`
echo
$ac_n
"checking for
$ac_hdr
""...
$ac_c
"
1>&6
echo
"configure:3
472
: checking for
$ac_hdr
"
>
&5
echo
"configure:3
515
: checking for
$ac_hdr
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_header_
$ac_safe
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 3
477
"configure"
#line 3
520
"configure"
#include "confdefs.h"
#include <
$ac_hdr
>
EOF
ac_try
=
"
$ac_cpp
conftest.
$ac_ext
>/dev/null 2>conftest.out"
{
(
eval echo
configure:3
482
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
{
(
eval echo
configure:3
525
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
ac_err
=
`
grep
-v
'^ *+'
conftest.out |
grep
-v
"^conftest.
${
ac_ext
}
\$
"
`
if
test
-z
"
$ac_err
"
;
then
rm
-rf
conftest
*
...
...
@@ -3549,17 +3592,17 @@ if test "${with_sdl+set}" = set; then
do
ac_safe
=
`
echo
"
$ac_hdr
"
|
sed
'y%./+-%__p_%'
`
echo
$ac_n
"checking for
$ac_hdr
""...
$ac_c
"
1>&6
echo
"configure:35
53
: checking for
$ac_hdr
"
>
&5
echo
"configure:35
96
: checking for
$ac_hdr
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_header_
$ac_safe
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 3
558
"configure"
#line 3
601
"configure"
#include "confdefs.h"
#include <
$ac_hdr
>
EOF
ac_try
=
"
$ac_cpp
conftest.
$ac_ext
>/dev/null 2>conftest.out"
{
(
eval echo
configure:3
563
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
{
(
eval echo
configure:3
606
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
ac_err
=
`
grep
-v
'^ *+'
conftest.out |
grep
-v
"^conftest.
${
ac_ext
}
\$
"
`
if
test
-z
"
$ac_err
"
;
then
rm
-rf
conftest
*
...
...
@@ -3597,17 +3640,17 @@ fi
do
ac_safe
=
`
echo
"
$ac_hdr
"
|
sed
'y%./+-%__p_%'
`
echo
$ac_n
"checking for
$ac_hdr
""...
$ac_c
"
1>&6
echo
"configure:36
01
: checking for
$ac_hdr
"
>
&5
echo
"configure:36
44
: checking for
$ac_hdr
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_header_
$ac_safe
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 36
06
"configure"
#line 36
49
"configure"
#include "confdefs.h"
#include <
$ac_hdr
>
EOF
ac_try
=
"
$ac_cpp
conftest.
$ac_ext
>/dev/null 2>conftest.out"
{
(
eval echo
configure:36
11
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
{
(
eval echo
configure:36
54
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
ac_err
=
`
grep
-v
'^ *+'
conftest.out |
grep
-v
"^conftest.
${
ac_ext
}
\$
"
`
if
test
-z
"
$ac_err
"
;
then
rm
-rf
conftest
*
...
...
@@ -3707,7 +3750,7 @@ if test x$enable_gtk != xno; then
# Extract the first word of "gtk-config", so it can be a program name with args.
set
dummy gtk-config
;
ac_word
=
$2
echo
$ac_n
"checking for
$ac_word
""...
$ac_c
"
1>&6
echo
"configure:37
11
: checking for
$ac_word
"
>
&5
echo
"configure:37
54
: checking for
$ac_word
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_path_GTK_CONFIG
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
...
...
@@ -3767,17 +3810,17 @@ if test x$enable_x11 != xno; then
do
ac_safe
=
`
echo
"
$ac_hdr
"
|
sed
'y%./+-%__p_%'
`
echo
$ac_n
"checking for
$ac_hdr
""...
$ac_c
"
1>&6
echo
"configure:3
771
: checking for
$ac_hdr
"
>
&5
echo
"configure:3
814
: checking for
$ac_hdr
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_header_
$ac_safe
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 3
776
"configure"
#line 3
819
"configure"
#include "confdefs.h"
#include <
$ac_hdr
>
EOF
ac_try
=
"
$ac_cpp
conftest.
$ac_ext
>/dev/null 2>conftest.out"
{
(
eval echo
configure:3
781
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
{
(
eval echo
configure:3
824
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
ac_err
=
`
grep
-v
'^ *+'
conftest.out |
grep
-v
"^conftest.
${
ac_ext
}
\$
"
`
if
test
-z
"
$ac_err
"
;
then
rm
-rf
conftest
*
...
...
@@ -3829,17 +3872,17 @@ if test x$enable_xvideo != xno; then
do
ac_safe
=
`
echo
"
$ac_hdr
"
|
sed
'y%./+-%__p_%'
`
echo
$ac_n
"checking for
$ac_hdr
""...
$ac_c
"
1>&6
echo
"configure:38
33
: checking for
$ac_hdr
"
>
&5
echo
"configure:38
76
: checking for
$ac_hdr
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_header_
$ac_safe
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 38
38
"configure"
#line 38
81
"configure"
#include "confdefs.h"
#include <
$ac_hdr
>
EOF
ac_try
=
"
$ac_cpp
conftest.
$ac_ext
>/dev/null 2>conftest.out"
{
(
eval echo
configure:38
43
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
{
(
eval echo
configure:38
86
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
ac_err
=
`
grep
-v
'^ *+'
conftest.out |
grep
-v
"^conftest.
${
ac_ext
}
\$
"
`
if
test
-z
"
$ac_err
"
;
then
rm
-rf
conftest
*
...
...
@@ -3877,17 +3920,17 @@ if test "${enable_alsa+set}" = set; then
enableval
=
"
$enable_alsa
"
if
test
x
$enable_alsa
=
xyes
;
then
ac_safe
=
`
echo
"sys/asoundlib.h"
|
sed
'y%./+-%__p_%'
`
echo
$ac_n
"checking for sys/asoundlib.h""...
$ac_c
"
1>&6
echo
"configure:3
881
: checking for sys/asoundlib.h"
>
&5
echo
"configure:3
924
: checking for sys/asoundlib.h"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_header_
$ac_safe
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 3
886
"configure"
#line 3
929
"configure"
#include "confdefs.h"
#include <sys/asoundlib.h>
EOF
ac_try
=
"
$ac_cpp
conftest.
$ac_ext
>/dev/null 2>conftest.out"
{
(
eval echo
configure:3
891
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
{
(
eval echo
configure:3
934
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
ac_err
=
`
grep
-v
'^ *+'
conftest.out |
grep
-v
"^conftest.
${
ac_ext
}
\$
"
`
if
test
-z
"
$ac_err
"
;
then
rm
-rf
conftest
*
...
...
@@ -3904,7 +3947,7 @@ fi
if
eval
"test
\"
`
echo
'$ac_cv_header_'
$ac_safe
`
\"
= yes"
;
then
echo
"
$ac_t
""yes"
1>&6
echo
$ac_n
"checking for main in -lasound""...
$ac_c
"
1>&6
echo
"configure:39
08
: checking for main in -lasound"
>
&5
echo
"configure:39
51
: checking for main in -lasound"
>
&5
ac_lib_var
=
`
echo
asound
'_'
main |
sed
'y%./+-%__p_%'
`
if
eval
"test
\"
`
echo
'$''{'
ac_cv_lib_
$ac_lib_var
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
...
...
@@ -3912,14 +3955,14 @@ else
ac_save_LIBS
=
"
$LIBS
"
LIBS
=
"-lasound
$LIBS
"
cat
>
conftest.
$ac_ext
<<
EOF
#line 39
16
"configure"
#line 39
59
"configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
if
{
(
eval echo
configure:39
23
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
if
{
(
eval echo
configure:39
66
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
rm
-rf
conftest
*
eval
"ac_cv_lib_
$ac_lib_var
=yes"
else
...
...
configure.in
View file @
d072e40d
...
...
@@ -153,9 +153,34 @@ dnl DVD module: check for DVD ioctls
dnl
AC_CHECK_HEADERS(sys/ioctl.h,[
BUILTINS="${BUILTINS} dvd"
AC_CHECK_HEADERS(linux/cdrom.h)
AC_EGREP_HEADER(dvd,linux/cdrom.h,[
AC_DEFINE(LINUX_DVD,1, DVD support for linux)
AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h)
BSD_DVD_STRUCT=0
dnl
dnl Old FreeBSD: sys/cdio.h
dnl
AC_EGREP_HEADER(dvd_struct,sys/dvdio.h,[
AC_DEFINE(DVD_STRUCT_IN_SYS_DVDIO_H, 1,
Define if <sys/dvdio.h> defines dvd_struct.)
BSD_DVD_STRUCT=1
])
dnl
dnl Newer FreeBSD: sys/dvdio.h
dnl
AC_EGREP_HEADER(dvd_struct,sys/cdio.h,[
AC_DEFINE(DVD_STRUCT_IN_SYS_CDIO_H, 1,
Define if <sys/cdio.h> defines dvd_struct.)
BSD_DVD_STRUCT=1
])
if test x$BSD_DVD_STRUCT = x1; then
AC_DEFINE(HAVE_BSD_DVD_STRUCT, 1,
Define if BSD-like dvd_struct is defined.)
fi
dnl
dnl Linux: linux/cdrom.h
dnl
AC_EGREP_HEADER(dvd_struct,linux/cdrom.h,[
AC_DEFINE(DVD_STRUCT_IN_LINUX_CDROM_H, 1,
Define if <linux/cdrom.h> defines DVD_STRUCT.)
])
])
...
...
include/defs.h.in
View file @
d072e40d
...
...
@@ -115,6 +115,12 @@
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <sys/cdio.h> header file. */
#undef HAVE_SYS_CDIO_H
/* Define if you have the <sys/dvdio.h> header file. */
#undef HAVE_SYS_DVDIO_H
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
...
...
@@ -154,8 +160,17 @@
/* Define if <pthread.h> defines boolean_t. */
#undef BOOLEAN_T_IN_PTHREAD_H
/* DVD support for linux */
#undef LINUX_DVD
/* Define if <sys/dvdio.h> defines dvd_struct. */
#undef DVD_STRUCT_IN_SYS_DVDIO_H
/* Define if <sys/cdio.h> defines dvd_struct. */
#undef DVD_STRUCT_IN_SYS_CDIO_H
/* Define if BSD-like dvd_struct is defined. */
#undef HAVE_BSD_DVD_STRUCT
/* Define if <linux/cdrom.h> defines DVD_STRUCT. */
#undef DVD_STRUCT_IN_LINUX_CDROM_H
/* Define if you want DVD CSS decryption. */
#undef HAVE_CSS
...
...
plugins/dvd/dvd_css.c
View file @
d072e40d
...
...
@@ -2,7 +2,7 @@
* dvd_css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_css.c,v 1.2
6 2001/04/22 00:08:25 stef
Exp $
* $Id: dvd_css.c,v 1.2
7 2001/05/02 20:01:44 sam
Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
...
...
@@ -120,7 +120,7 @@ int CSSInit( int i_fd, css_t * p_css )
{
intf_WarnMsg
(
3
,
"css info: requesting AGID %d"
,
i
);
i_ret
=
ioctl_
LUSend
Agid
(
i_fd
,
&
i_agid
);
i_ret
=
ioctl_
Report
Agid
(
i_fd
,
&
i_agid
);
if
(
i_ret
!=
-
1
)
{
...
...
@@ -128,7 +128,7 @@ int CSSInit( int i_fd, css_t * p_css )
break
;
}
intf_ErrMsg
(
"css error: ioctl_
LUSend
Agid failed, invalidating"
);
intf_ErrMsg
(
"css error: ioctl_
Report
Agid failed, invalidating"
);
i_agid
=
0
;
ioctl_InvalidateAgid
(
i_fd
,
&
i_agid
);
...
...
@@ -137,7 +137,7 @@ int CSSInit( int i_fd, css_t * p_css )
/* Unable to authenticate without AGID */
if
(
i_ret
==
-
1
)
{
intf_ErrMsg
(
"css error: ioctl_
LUSend
Agid failed, fatal"
);
intf_ErrMsg
(
"css error: ioctl_
Report
Agid failed, fatal"
);
return
-
1
;
}
...
...
@@ -153,16 +153,16 @@ int CSSInit( int i_fd, css_t * p_css )
}
/* Send challenge to LU */
if
(
ioctl_
Host
SendChallenge
(
i_fd
,
&
i_agid
,
p_buffer
)
<
0
)
if
(
ioctl_SendChallenge
(
i_fd
,
&
i_agid
,
p_buffer
)
<
0
)
{
intf_ErrMsg
(
"css error: ioctl_
Host
SendChallenge failed"
);
intf_ErrMsg
(
"css error: ioctl_SendChallenge failed"
);
return
-
1
;
}
/* Get key1 from LU */
if
(
ioctl_
LUSend
Key1
(
i_fd
,
&
i_agid
,
p_buffer
)
<
0
)
if
(
ioctl_
Report
Key1
(
i_fd
,
&
i_agid
,
p_buffer
)
<
0
)
{
intf_ErrMsg
(
"css error: ioctl_
LUSend
Key1 failed"
);
intf_ErrMsg
(
"css error: ioctl_
Report
Key1 failed"
);
return
-
1
;
}
...
...
@@ -193,9 +193,9 @@ int CSSInit( int i_fd, css_t * p_css )
}
/* Get challenge from LU */
if
(
ioctl_
LUSend
Challenge
(
i_fd
,
&
i_agid
,
p_buffer
)
<
0
)
if
(
ioctl_
Report
Challenge
(
i_fd
,
&
i_agid
,
p_buffer
)
<
0
)
{
intf_ErrMsg
(
"css error: ioctl_
LUSend
KeyChallenge failed"
);
intf_ErrMsg
(
"css error: ioctl_
Report
KeyChallenge failed"
);
return
-
1
;
}
...
...
@@ -215,9 +215,9 @@ int CSSInit( int i_fd, css_t * p_css )
}
/* Send key2 to LU */
if
(
ioctl_
Host
SendKey2
(
i_fd
,
&
i_agid
,
p_buffer
)
<
0
)
if
(
ioctl_SendKey2
(
i_fd
,
&
i_agid
,
p_buffer
)
<
0
)
{
intf_ErrMsg
(
"css error: ioctl_
Host
SendKey2 failed"
);
intf_ErrMsg
(
"css error: ioctl_SendKey2 failed"
);
return
-
1
;
}
...
...
@@ -456,7 +456,7 @@ static int CSSGetASF( int i_fd )
for
(
i_agid
=
0
;
i_agid
<
4
;
i_agid
++
)
{
if
(
ioctl_
LUSend
ASF
(
i_fd
,
&
i_agid
,
&
i_asf
)
==
0
)
if
(
ioctl_
Report
ASF
(
i_fd
,
&
i_agid
,
&
i_asf
)
==
0
)
{
intf_WarnMsg
(
3
,
"css info: GetASF %sauthenticated"
,
i_asf
?
""
:
"not "
);
...
...
plugins/dvd/dvd_ioctl.c
View file @
d072e40d
...
...
@@ -2,7 +2,7 @@
* dvd_ioctl.c: DVD ioctl replacement function
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ioctl.c,v 1.1
0 2001/04/11 04:46:18
sam Exp $
* $Id: dvd_ioctl.c,v 1.1
1 2001/05/02 20:01:44
sam Exp $
*
* Authors: Markus Kuespert <ltlBeBoy@beosmail.com>
* Samuel Hocevar <sam@zoy.org>
...
...
@@ -31,22 +31,21 @@
#include <sys/types.h>
#include <netinet/in.h>
#ifdef HAVE_SYS_DVDIO_H
# include <sys/ioctl.h>
#include <sys/ioctl.h>
#ifdef DVD_STRUCT_IN_SYS_CDIO_H
# include <sys/cdio.h>
#endif
#ifdef DVD_STRUCT_IN_SYS_DVDIO_H
# include <sys/dvdio.h>
#endif
#ifdef LINUX_DVD
# include <sys/ioctl.h>
#ifdef DVD_STRUCT_IN_LINUX_CDROM_H
# include <linux/cdrom.h>
#endif
#ifdef SYS_BEOS
# include <sys/ioctl.h>
# include <malloc.h>
# include <scsi.h>
#endif
#ifdef SYS_DARWIN1_3
# include <sys/ioctl.h>
#endif
#include "common.h"
...
...
@@ -77,7 +76,7 @@ int ioctl_ReadCopyright( int i_fd, int i_layer, int *pi_copyright )
{
int
i_ret
;
#if defined(
HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD
)
#if defined(
DVD_STRUCT_IN_LINUX_CDROM_H
)
dvd_struct
dvd
;
dvd
.
type
=
DVD_STRUCT_COPYRIGHT
;
...
...
@@ -87,6 +86,16 @@ int ioctl_ReadCopyright( int i_fd, int i_layer, int *pi_copyright )
*
pi_copyright
=
dvd
.
copyright
.
cpst
;
#elif defined( HAVE_BSD_DVD_STRUCT )
struct
dvd_struct
dvd
;
dvd
.
format
=
DVD_STRUCT_COPYRIGHT
;
dvd
.
layer_num
=
i_layer
;
i_ret
=
ioctl
(
i_fd
,
DVDIOCREADSTRUCTURE
,
&
dvd
);
*
pi_copyright
=
dvd
.
cpst
;
#elif defined( SYS_BEOS )
INIT_RDC
(
GPCMD_READ_DVD_STRUCTURE
,
8
);
...
...
@@ -120,12 +129,11 @@ int ioctl_ReadKey( int i_fd, int *pi_agid, u8 *p_key )
{
int
i_ret
;
#if defined(
HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD
)
#if defined(
DVD_STRUCT_IN_LINUX_CDROM_H
)
dvd_struct
dvd
;
dvd
.
type
=
DVD_STRUCT_DISCKEY
;
dvd
.
disckey
.
agid
=
*
pi_agid
;
memset
(
dvd
.
disckey
.
value
,
0
,
2048
);
i_ret
=
ioctl
(
i_fd
,
DVD_READ_STRUCT
,
&
dvd
);
...
...
@@ -137,6 +145,22 @@ int ioctl_ReadKey( int i_fd, int *pi_agid, u8 *p_key )
memcpy
(
p_key
,
dvd
.
disckey
.
value
,
2048
);
#elif defined( HAVE_BSD_DVD_STRUCT )
struct
dvd_struct
dvd
;
dvd
.
format
=
DVD_STRUCT_DISCKEY
;
dvd
.
agid
=
*
pi_agid
;
memset
(
dvd
.
data
,
0
,
2048
);
i_ret
=
ioctl
(
i_fd
,
DVDIOCREADSTRUCTURE
,
&
dvd
);
if
(
i_ret
<
0
)
{
return
i_ret
;
}
memcpy
(
p_key
,
dvd
.
data
,
2048
);
#elif defined( SYS_BEOS )
INIT_RDC
(
GPCMD_READ_DVD_STRUCTURE
,
2048
+
4
);
...
...
@@ -161,13 +185,13 @@ int ioctl_ReadKey( int i_fd, int *pi_agid, u8 *p_key )
}
/*****************************************************************************
* ioctl_
LUSend
Agid: get AGID from the drive
* ioctl_
Report
Agid: get AGID from the drive
*****************************************************************************/
int
ioctl_
LUSend
Agid
(
int
i_fd
,
int
*
pi_agid
)
int
ioctl_
Report
Agid
(
int
i_fd
,
int
*
pi_agid
)
{
int
i_ret
;
#if defined(
HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD
)
#if defined(
DVD_STRUCT_IN_LINUX_CDROM_H
)
dvd_authinfo
auth_info
;
auth_info
.
type
=
DVD_LU_SEND_AGID
;
...
...
@@ -177,6 +201,16 @@ int ioctl_LUSendAgid( int i_fd, int *pi_agid )
*
pi_agid
=
auth_info
.
lsa
.
agid
;
#elif defined( HAVE_BSD_DVD_STRUCT )
struct
dvd_authinfo
auth_info
;
auth_info
.
format
=
DVD_REPORT_AGID
;
auth_info
.
agid
=
*
pi_agid
;
i_ret
=
ioctl
(
i_fd
,
DVDIOCREPORTKEY
,
&
auth_info
);
*
pi_agid
=
auth_info
.
agid
;
#elif defined( SYS_BEOS )
INIT_RDC
(
GPCMD_REPORT_KEY
,
8
);
...
...
@@ -195,13 +229,13 @@ int ioctl_LUSendAgid( int i_fd, int *pi_agid )
}
/*****************************************************************************
* ioctl_
LUSend
Challenge: get challenge from the drive
* ioctl_
Report
Challenge: get challenge from the drive
*****************************************************************************/
int
ioctl_
LUSend
Challenge
(
int
i_fd
,
int
*
pi_agid
,
u8
*
p_challenge
)
int
ioctl_
Report
Challenge
(
int
i_fd
,
int
*
pi_agid
,
u8
*
p_challenge
)
{
int
i_ret
;
#if defined(
HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD
)
#if defined(
DVD_STRUCT_IN_LINUX_CDROM_H
)
dvd_authinfo
auth_info
;
auth_info
.
type
=
DVD_LU_SEND_CHALLENGE
;
...
...
@@ -211,6 +245,16 @@ int ioctl_LUSendChallenge( int i_fd, int *pi_agid, u8 *p_challenge )
memcpy
(
p_challenge
,
auth_info
.
lsc
.
chal
,
sizeof
(
dvd_challenge
)
);
#elif defined( HAVE_BSD_DVD_STRUCT )
struct
dvd_authinfo
auth_info
;
auth_info
.
format
=
DVD_REPORT_CHALLENGE
;
auth_info
.
agid
=
*
pi_agid
;
i_ret
=
ioctl
(
i_fd
,
DVDIOCREPORTKEY
,
&
auth_info
);
memcpy
(
p_challenge
,
auth_info
.
keychal
,
10
);
#elif defined( SYS_BEOS )
INIT_RDC
(
GPCMD_REPORT_KEY
,
16
);
...
...
@@ -229,13 +273,13 @@ int ioctl_LUSendChallenge( int i_fd, int *pi_agid, u8 *p_challenge )
}
/*****************************************************************************
* ioctl_
LUSend
ASF: get ASF from the drive
* ioctl_
Report
ASF: get ASF from the drive
*****************************************************************************/
int
ioctl_
LUSend
ASF
(
int
i_fd
,
int
*
pi_agid
,
int
*
pi_asf
)
int
ioctl_
Report
ASF
(
int
i_fd
,
int
*
pi_agid
,
int
*
pi_asf
)
{
int
i_ret
;
#if defined(
HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD
)
#if defined(
DVD_STRUCT_IN_LINUX_CDROM_H
)
dvd_authinfo
auth_info
;
auth_info
.
type
=
DVD_LU_SEND_ASF
;
...
...
@@ -246,6 +290,17 @@ int ioctl_LUSendASF( int i_fd, int *pi_agid, int *pi_asf )
*
pi_asf
=
auth_info
.
lsasf
.
asf
;
#elif defined( HAVE_BSD_DVD_STRUCT )
struct
dvd_authinfo
auth_info
;
auth_info
.
format
=
DVD_REPORT_ASF
;
auth_info
.
agid
=
*
pi_agid
;
auth_info
.
asf
=
*
pi_asf
;
i_ret
=
ioctl
(
i_fd
,
DVDIOCREPORTKEY
,
&
auth_info
);
*
pi_asf
=
auth_info
.
asf
;
#elif defined( SYS_BEOS )
INIT_RDC
(
GPCMD_REPORT_KEY
,
8
);
...
...
@@ -278,13 +333,13 @@ int ioctl_LUSendASF( int i_fd, int *pi_agid, int *pi_asf )
}
/*****************************************************************************
* ioctl_
LUSend
Key1: get the first key from the drive
* ioctl_
Report
Key1: get the first key from the drive
*****************************************************************************/
int
ioctl_
LUSend
Key1
(
int
i_fd
,
int
*
pi_agid
,
u8
*
p_key
)
int
ioctl_
Report
Key1
(
int
i_fd
,
int
*
pi_agid
,
u8
*
p_key
)
{
int
i_ret
;
#if defined(
HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD
)
#if defined(
DVD_STRUCT_IN_LINUX_CDROM_H
)
dvd_authinfo
auth_info
;
auth_info
.
type
=
DVD_LU_SEND_KEY1
;
...
...
@@ -294,6 +349,16 @@ int ioctl_LUSendKey1( int i_fd, int *pi_agid, u8 *p_key )
memcpy
(
p_key
,
auth_info
.
lsk
.
key
,
sizeof
(
dvd_key
)
);
#elif defined( HAVE_BSD_DVD_STRUCT )
struct
dvd_authinfo
auth_info
;
auth_info
.
format
=
DVD_REPORT_KEY1
;
auth_info
.
agid
=
*
pi_agid
;
i_ret
=
ioctl
(
i_fd
,
DVDIOCREPORTKEY
,
&
auth_info
);
memcpy
(
p_key
,
auth_info
.
keychal
,
8
);
#elif defined( SYS_BEOS )
INIT_RDC
(
GPCMD_REPORT_KEY
,
12
);
...
...
@@ -318,7 +383,7 @@ int ioctl_InvalidateAgid( int i_fd, int *pi_agid )
{
int
i_ret
;
#if defined(
HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD
)
#if defined(
DVD_STRUCT_IN_LINUX_CDROM_H
)
dvd_authinfo
auth_info
;
auth_info
.
type
=
DVD_INVALIDATE_AGID
;
...
...
@@ -328,6 +393,16 @@ int ioctl_InvalidateAgid( int i_fd, int *pi_agid )
*
pi_agid
=
auth_info
.
lsa
.
agid
;
#elif defined( HAVE_BSD_DVD_STRUCT )
struct
dvd_authinfo
auth_info
;
auth_info
.
format
=
DVD_INVALIDATE_AGID
;
auth_info
.
agid
=
*
pi_agid
;
i_ret
=
ioctl
(
i_fd
,
DVDIOCREPORTKEY
,
&
auth_info
);
*
pi_agid
=
auth_info
.
agid
;
#elif defined( SYS_BEOS )
INIT_RDC
(
GPCMD_REPORT_KEY
,
0
);
...
...
@@ -344,11 +419,11 @@ int ioctl_InvalidateAgid( int i_fd, int *pi_agid )
}
/*****************************************************************************
* ioctl_
Host
SendChallenge: send challenge to the drive
* ioctl_SendChallenge: send challenge to the drive
*****************************************************************************/
int
ioctl_
Host
SendChallenge
(
int
i_fd
,
int
*
pi_agid
,
u8
*
p_challenge
)
int
ioctl_SendChallenge
(
int
i_fd
,
int
*
pi_agid
,
u8
*
p_challenge
)
{
#if defined(
HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD
)
#if defined(
DVD_STRUCT_IN_LINUX_CDROM_H
)
dvd_authinfo
auth_info
;
auth_info
.
type
=
DVD_HOST_SEND_CHALLENGE
;
...
...
@@ -358,6 +433,16 @@ int ioctl_HostSendChallenge( int i_fd, int *pi_agid, u8 *p_challenge )
return
ioctl
(
i_fd
,
DVD_AUTH
,
&
auth_info
);
#elif defined( HAVE_BSD_DVD_STRUCT )
struct
dvd_authinfo
auth_info
;
auth_info
.
format
=
DVD_SEND_CHALLENGE
;
auth_info
.
agid
=
*
pi_agid
;
memcpy
(
auth_info
.
keychal
,
p_challenge
,
12
);
return
ioctl
(
i_fd
,
DVDIOCSENDKEY
,
&
auth_info
);
#elif defined( SYS_BEOS )
INIT_RDC
(
GPCMD_SEND_KEY
,
16
);
...
...
@@ -376,11 +461,11 @@ int ioctl_HostSendChallenge( int i_fd, int *pi_agid, u8 *p_challenge )
}
/*****************************************************************************
* ioctl_
Host
SendKey2: send the second key to the drive
* ioctl_SendKey2: send the second key to the drive
*****************************************************************************/
int
ioctl_
Host
SendKey2
(
int
i_fd
,
int
*
pi_agid
,
u8
*
p_key
)
int
ioctl_SendKey2
(
int
i_fd
,
int
*
pi_agid
,
u8
*
p_key
)
{
#if defined(
HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD
)
#if defined(
DVD_STRUCT_IN_LINUX_CDROM_H
)
dvd_authinfo
auth_info
;
auth_info
.
type
=
DVD_HOST_SEND_KEY2
;
...
...
@@ -390,6 +475,16 @@ int ioctl_HostSendKey2( int i_fd, int *pi_agid, u8 *p_key )
return
ioctl
(
i_fd
,
DVD_AUTH
,
&
auth_info
);
#elif defined( HAVE_BSD_DVD_STRUCT )
struct
dvd_authinfo
auth_info
;
auth_info
.
format
=
DVD_SEND_KEY2
;
auth_info
.
agid
=
*
pi_agid
;
memcpy
(
auth_info
.
keychal
,
p_key
,
8
);
return
ioctl
(
i_fd
,
DVDIOCSENDKEY
,
&
auth_info
);
#elif defined( SYS_BEOS )
INIT_RDC
(
GPCMD_SEND_KEY
,
12
);
...
...
plugins/dvd/dvd_ioctl.h
View file @
d072e40d
...
...
@@ -2,7 +2,7 @@
* dvd_ioctl.h: DVD ioctl replacement function
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ioctl.h,v 1.
6 2001/04/11 04:31:59
sam Exp $
* $Id: dvd_ioctl.h,v 1.
7 2001/05/02 20:01:44
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -24,13 +24,13 @@
int
ioctl_ReadCopyright
(
int
,
int
,
int
*
);
int
ioctl_ReadKey
(
int
,
int
*
,
u8
*
);
int
ioctl_
LUSend
Agid
(
int
,
int
*
);
int
ioctl_
LUSend
Challenge
(
int
,
int
*
,
u8
*
);
int
ioctl_
LUSend
Key1
(
int
,
int
*
,
u8
*
);
int
ioctl_
LUSend
ASF
(
int
,
int
*
,
int
*
);
int
ioctl_
Report
Agid
(
int
,
int
*
);
int
ioctl_
Report
Challenge
(
int
,
int
*
,
u8
*
);
int
ioctl_
Report
Key1
(
int
,
int
*
,
u8
*
);
int
ioctl_
Report
ASF
(
int
,
int
*
,
int
*
);
int
ioctl_InvalidateAgid
(
int
,
int
*
);
int
ioctl_
HostSendChallenge
(
int
,
int
*
,
u8
*
);
int
ioctl_
HostSendKey2
(
int
,
int
*
,
u8
*
);
int
ioctl_
SendChallenge
(
int
,
int
*
,
u8
*
);
int
ioctl_
SendKey2
(
int
,
int
*
,
u8
*
);
#ifdef SYS_BEOS
...
...
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