Skip to content

EsanLe/android-tcpdump-service-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tcpdumpservice and Tcpdumpclient

TCPDUMP as Application Framework

  • An app with UI get packets form binder service by JNI invoking of servicemanager
  • A native service using binder and get packets by libpcap api

Screenshot

Build and flash to rom

  1. Download AOSP and put tcpdumpclient tcpdumpservice to external folder of AOSP.
  2. Build and run your AOSP

Build and just test without build entire AOSP

  1. Download AOSP and put tcpdumpclient tcpdumpservice to external folder of AOSP.
  2. Use the script in the folders to build only the app or native app
  3. Push native app to /data/local/tmp and run it
  4. Make a project in eclipse ADT and copy app code to ADT
  5. Make a lib folder in eclipse ADT project and copy libtcpdumpclient.so to it

Implement apis by libpcap

Wrap up TCPDUMP program to provide necessary APIs

`Bool  getDataPacketFromIP (char *ip, char *packet)`
`Bool  getDataPacketToIP (char *ip, char *packet)`
`Bool  getDataPacketFromIPAndPort (char *ip, char *port, char *packet)`
`Bool  getDataPacketFromPort (char *port, char *packet)`
`Bool  getDataPacketToPort (char *port, char *packet)`
`Bool  getDataPacketFromIPToIP (char *srcip, char *dstip  char *packet)`
`Bool  getDataPacketFromMac (char* mac, char* packet)`
`Bool  getDataPacketToMac (char* mac, char* packet)`
`Bool  getDataPacketFromMacToMac (char *srcmac, char *desmac, char *packet)`
`Bool  getDataPacketWithProtocol (protocolType type, char* packet)`

Start Tcpdumpservice when system boots up

  1. Open /system/core/rootdir/init.rc
  2. Add this
service tcpdumpservice /system/bin/tcpdumpservice
class main
user root
group root

Reference

About

Integrate Tcpdump in AOSP as application framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published