Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
system_netd
Commits
855a369c
Commit
855a369c
authored
12 years ago
by
Robert Greenwalt
Committed by
Android (Google) Code Review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "Remove Broadcom hack for BT reverse Tether" into jb-mr2-dev
parents
36971a68
6222d86f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
80 deletions
+0
-80
CommandListener.cpp
CommandListener.cpp
+0
-6
TetherController.cpp
TetherController.cpp
+0
-70
TetherController.h
TetherController.h
+0
-4
No files found.
CommandListener.cpp
View file @
855a369c
...
...
@@ -541,12 +541,6 @@ int CommandListener::TetherCmd::runCommand(SocketClient *cli,
if
(
!
strcmp
(
argv
[
1
],
"stop"
))
{
rc
=
sTetherCtrl
->
stopTethering
();
}
else
if
(
!
strcmp
(
argv
[
1
],
"start-reverse"
))
{
ALOGD
(
"CommandListener::TetherCmd::run, call startReverseTethering, iface:%s"
,
argv
[
2
]);
sTetherCtrl
->
startReverseTethering
(
argv
[
2
]);
}
else
if
(
!
strcmp
(
argv
[
1
],
"stop-reverse"
))
{
ALOGD
(
"CommandListener::TetherCmd::run, call stopReverseTethering"
);
rc
=
sTetherCtrl
->
stopReverseTethering
();
}
else
if
(
!
strcmp
(
argv
[
1
],
"status"
))
{
char
*
tmp
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
TetherController.cpp
View file @
855a369c
...
...
@@ -38,7 +38,6 @@ TetherController::TetherController() {
mDnsForwarders
=
new
NetAddressCollection
();
mDaemonFd
=
-
1
;
mDaemonPid
=
0
;
mDhcpcdPid
=
0
;
}
TetherController
::~
TetherController
()
{
...
...
@@ -188,75 +187,6 @@ int TetherController::stopTethering() {
return
0
;
}
// TODO(BT) remove
int
TetherController
::
startReverseTethering
(
const
char
*
iface
)
{
if
(
mDhcpcdPid
!=
0
)
{
ALOGE
(
"Reverse tethering already started"
);
errno
=
EBUSY
;
return
-
1
;
}
ALOGD
(
"TetherController::startReverseTethering, Starting reverse tethering"
);
/*
* TODO: Create a monitoring thread to handle and restart
* the daemon if it exits prematurely
*/
//cleanup the dhcp result
char
dhcp_result_name
[
64
];
snprintf
(
dhcp_result_name
,
sizeof
(
dhcp_result_name
)
-
1
,
"dhcp.%s.result"
,
iface
);
property_set
(
dhcp_result_name
,
""
);
pid_t
pid
;
if
((
pid
=
fork
())
<
0
)
{
ALOGE
(
"fork failed (%s)"
,
strerror
(
errno
));
return
-
1
;
}
if
(
!
pid
)
{
char
*
args
[
10
];
int
argc
=
0
;
args
[
argc
++
]
=
(
char
*
)
"/system/bin/dhcpcd"
;
char
host_name
[
128
];
if
(
property_get
(
"net.hostname"
,
host_name
,
NULL
)
&&
(
host_name
[
0
]
!=
'\0'
))
{
args
[
argc
++
]
=
(
char
*
)
"-h"
;
args
[
argc
++
]
=
host_name
;
}
args
[
argc
++
]
=
(
char
*
)
iface
;
args
[
argc
]
=
NULL
;
if
(
execv
(
args
[
0
],
args
))
{
ALOGE
(
"startReverseTethering, execv failed (%s)"
,
strerror
(
errno
));
}
ALOGE
(
"startReverseTethering, Should never get here!"
);
// TODO(BT) inform parent of the failure.
// Parent process need wait for child to report error status
// before it set mDhcpcdPid and return 0.
_exit
(
-
1
);
}
else
{
mDhcpcdPid
=
pid
;
ALOGD
(
"Reverse Tethering running, pid:%d"
,
pid
);
}
return
0
;
}
// TODO(BT) remove
int
TetherController
::
stopReverseTethering
()
{
if
(
mDhcpcdPid
==
0
)
{
ALOGE
(
"Tethering already stopped"
);
return
0
;
}
ALOGD
(
"Stopping tethering services"
);
kill
(
mDhcpcdPid
,
SIGTERM
);
waitpid
(
mDhcpcdPid
,
NULL
,
0
);
mDhcpcdPid
=
0
;
ALOGD
(
"Tethering services stopped"
);
return
0
;
}
bool
TetherController
::
isTetheringStarted
()
{
return
(
mDaemonPid
==
0
?
false
:
true
);
}
...
...
This diff is collapsed.
Click to expand it.
TetherController.h
View file @
855a369c
...
...
@@ -28,7 +28,6 @@ class TetherController {
InterfaceCollection
*
mInterfaces
;
NetAddressCollection
*
mDnsForwarders
;
pid_t
mDaemonPid
;
pid_t
mDhcpcdPid
;
int
mDaemonFd
;
public:
...
...
@@ -43,9 +42,6 @@ public:
int
stopTethering
();
bool
isTetheringStarted
();
int
startReverseTethering
(
const
char
*
iface
);
int
stopReverseTethering
();
int
setDnsForwarders
(
char
**
servers
,
int
numServers
);
NetAddressCollection
*
getDnsForwarders
();
...
...
This diff is collapsed.
Click to expand it.
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