TraceRoute在机器人 [英] Traceroute on android

查看:224
本文介绍了TraceRoute在机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在android平台的初学者,我想建立一个tracerouting应用程序。因此,这些都是我的一些疑问,我要问:

I am a beginner on android platform, and i want to build a tracerouting app. So these are some my queries that I want to ask:

  1. 是否有可能做出这样的应用程序在Android中?如果可能的话然后引导我,我要走的路。

  1. Is it possible to make such application in Android? if possible then guide me the way that I follow.

是否支持Android底层编程来捕获ICMP数据包?或者我需要添加一些JAR(Java)中或其他一些库,以支持该应用程序。

Does Android support low level programming to capture ICMP packets? or do I need to add some kind of JAR (in java) or some other libraries to support this application.

在Java中有JPCAP和docjar等种类,我们可以在我们的IDE或Eclipse导入库,以便作出这样那样的API的Java支持?

In Java there are JPCAP and docjar etc kind of libraries that we can import in our IDE or Eclipse so that Java support for making such kind of api's?

我需要的有价值的建议。

I need valuable suggestions.

推荐答案

我能想到的最简单的方法是只检查了路由跟踪 Linux应用程序,执行它,并解析它的输出。

The simplest way I can think of is to just check for the traceroute Linux application, execute it, and parse its output.

Android有完整的网络支持,然而,Java不公开接口改变IP报头。因此,手工手工制作的ICMP包是不可能的(JPCAP没有帮助在这里,因为它依赖于libpcap的,我想你不会找到任何香草安装)。

Android has full networking support, however, Java doesn't expose an interface to alter the IP header. Hence, manually crafting ICMP packages is out of the question (JPCAP is no help here, since it relies on libpcap, which I suppose you won't find on any vanilla installation).

另外的可能的解决方案是使用NDK并创建一个小型图书馆,处理低级别的数字运算。不过,我不知道,如果NDK将允许您使用的setsockopt

Another possible solution is to use the NDK and create a small library that handles the low-level number crunching. However, I'm not sure if the NDK would allow you to use setsockopt.

这篇关于TraceRoute在机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆