Giter Site home page Giter Site logo

lanscan's Introduction

LanScan

ios版的局域网扫描器, 网络工具包 支持udp,icmp,arp,https, 获取网关,ssid,bssid,ip,mac,压缩版的Reachability,方便开放网络相关的项目使用效果如下 image 11.12新加ios版的nginx, 方便内网上传资料, demo是上传图片的, 如果要上传其他的, 自己改一下那个callback方法就可以了, 目前图片太大会有问题, buff是300k image

lanscan's People

Contributors

zhouguangwu avatar

Stargazers

 avatar  avatar T3LS avatar  avatar  avatar 傅华 avatar codebeautiful avatar xThink avatar centery avatar  avatar 珈蓝夜宇 avatar  avatar  avatar moonrailgun avatar Rover avatar  avatar Gatling avatar WT avatar Franky J avatar 锅师傅 avatar showtzx avatar  avatar  avatar  avatar

Watchers

WT avatar showtzx avatar  avatar

lanscan's Issues

野指针了啊

  • (NSString *) gateway2{
    int mib[6] = {CTL_NET,
    PF_ROUTE,//其实就是af_route的define
    0, AF_INET,
    NET_RT_FLAGS, RTF_GATEWAY};
    size_t len;
    NSAssert(sysctl(mib,sizeof(mib)/sizeof(int), 0, &len, 0, 0) >= 0, @"取长度出错");
    // NSLog(@"sysctl buf长度%zd",len);
    char *buf = calloc(len, 1);
    NSAssert(sysctl(mib,sizeof(mib)/sizeof(int), buf, &len, 0, 0) >= 0, @"取长度出错");
    // NSLog(@"实际内容长度%zd",len);
    struct rt_msghdr *rtptr = (struct rt_msghdr *)buf;//routeptr, 后面解析数据就一样的了
    struct sockaddr *sa = (struct sockaddr *)(rtptr + 1);
    struct sockaddr_in *gateway = (struct sockaddr_in *)((char *)sa + sa->sa_len);//第一个是RTAX_DST, 我们只要网关
    free(rtptr);
    // NSLog(@"%s",inet_ntoa(gateway->sin_addr));
    return [NSString stringWithUTF8String:inet_ntoa(gateway->sin_addr)];
    }

    return [NSString stringWithUTF8String:inet_ntoa(gateway->sin_addr)];
    返回的时候报错了

适配IPv6-Only网络

您好,我现在想使用您写的这个demo获取手机mac地址,但是如果我想适配IPv6-Only网络的话还需要修改哪些地方呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.