资源简介
该资源是移远LTE/4G移植的源代码,请有需要的朋友自行下载,管局如何移植行参考博主的博客,没有积分的朋友请联系博主。

代码片段和文件信息
#ifdef ANDROID
/*
* Copyright 2008 The Android Open Source Project
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include
#include
#include
#include
#include
#include
#include
#include “QMIThread.h“
#ifdef USE_NDK
extern int (*ifc_init)(void);
extern void (*ifc_close)(void);
extern int (*do_dhcp)(const char *iname);
extern void (*get_dhcp_info)(uint32_t *ipaddr uint32_t *gateway uint32_t *prefixLength
uint32_t *dns1 uint32_t *dns2 uint32_t *server
uint32_t *lease);
extern int (*property_set)(const char *key const char *value);
#else
#include
#include
extern int do_dhcp(const char *iname);
extern void get_dhcp_info(uint32_t *ipaddr uint32_t *gateway uint32_t *prefixLength
uint32_t *dns1 uint32_t *dns2 uint32_t *server
uint32_t *lease);
#endif
static const char *ipaddr_to_string(in_addr_t addr)
{
struct in_addr in_addr;
in_addr.s_addr = addr;
return inet_ntoa(in_addr);
}
void do_dhcp_request(PROFILE_T *profile) {
#ifdef USE_NDK
if (!ifc_init ||!ifc_close ||!do_dhcp || !get_dhcp_info || !property_set) {
return;
}
#endif
char *ifname = profile->usbnet_adapter;
uint32_t ipaddr gateway prefixLength dns1 dns2 server lease;
char propKey[128];
#if 0
if (profile->rawIP && ((profile->IPType==0x04 && profile->ipv4.Address)))
{
snprintf(propKey sizeof(propKey) “net.%s.dns1“ ifname);
property_set(propKey profile->ipv4.DnsPrimary ? ipaddr_to_string(ql_swap32(profile->ipv4.DnsPrimary)) : “8.8.8.8“);
snprintf(propKey sizeof(propKey) “net.%s.dns2“ ifname);
property_set(propKey profile->ipv4.DnsSecondary ? ipaddr_to_string(ql_swap32(profile->ipv4.DnsSecondary)) : “8.8.8.8“);
snprintf(propKey sizeof(propKey) “net.%s.gw“ ifname);
property_set(propKey profile->ipv4.Gateway ? ipaddr_to_string(ql_swap32(profile->ipv4.Gateway)) : “0.0.0.0“);
return;
}
#endif
if(ifc_init()) {
dbg_time(“failed to ifc_init(%s): %s\n“ ifname strerror(errno));
}
if (do_dhcp(ifname) < 0) {
dbg_time(“failed to do_dhcp(%s): %s\n“ ifname strerror(errno));
}
ifc_close();
get_dhcp_info(&ipaddr &gateway &prefixLength
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-08-19 19:11 移远移植-Linux\
目录 0 2018-08-19 19:10 移远移植-Linux\内核源码\
文件 48563 2018-08-17 14:31 移远移植-Linux\内核源码\src.zip
目录 0 2018-08-19 19:11 移远移植-Linux\参考手册\
文件 1103545 2017-09-04 10:43 移远移植-Linux\参考手册\Quectel_WCDMA<E_Linux_USB_Driver_User_Guide_V1.8.pdf
目录 0 2018-08-19 19:10 移远移植-Linux\拨号程序\
目录 0 2018-08-19 19:10 移远移植-Linux\拨号程序\源码\
目录 0 2018-08-19 19:10 移远移植-Linux\拨号程序\源码\quectel-CM\
文件 7636 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\GobiNetCM.c
文件 13830 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\MPQCTL.h
文件 6360 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\MPQMI.h
文件 20607 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\MPQMUX.c
文件 111502 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\MPQMUX.h
文件 763 2018-08-18 11:14 移远移植-Linux\拨号程序\源码\quectel-CM\Makefile
文件 79003 2017-11-03 13:42 移远移植-Linux\拨号程序\源码\quectel-CM\QMIThread.c
文件 5527 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\QMIThread.h
文件 10693 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\QmiWwanCM.c
文件 1358 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\default.sc
文件 3185 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\dhcpclient.c
文件 34622 2017-11-03 13:41 移远移植-Linux\拨号程序\源码\quectel-CM\main.c
文件 100378 2018-08-18 11:13 移远移植-Linux\拨号程序\源码\quectel-CM\quectel-CM
文件 10324 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\udhcpc.c
文件 3860 2017-09-25 19:53 移远移植-Linux\拨号程序\源码\quectel-CM\util.c
文件 1714 2017-09-09 16:57 移远移植-Linux\拨号程序\源码\quectel-CM\util.h
- 上一篇:CC2530 BasicRFTI源文件
- 下一篇:流量监控源码
相关资源
- linux系统下的内存测试工具
- GNU/Linux系统开发者需要从桌面突破
- the_definitive_guide_to_linux_network_programm
- linux-shell脚本命令:grep命令简介
- Learning Linux Binary Analysis
- 蓝牙源代码应用于LINUX
- uboot到linux logo显示不间断 补丁
- UNIX/LINUX编程实践教程的源码
- Linux任务管理器
- linux应用层的华容道游戏源代码
- ubuntu9.10 可加载内核模块和字符设备驱
- MP3文件ID3v2ID3v2APEv2标签读取
- 操作系统实验——虚存管理实验
- linux下的发包工具sendip
- 尚观培训linux许巍关于c 的笔记和讲义
- 尚观培训linux董亮老师关于数据结构的
- linux 线程池源码 c 版
- linux C 电梯程序练习
- linux下用多进程同步方法解决生产者
- Linux 操作系统实验(全)
- Linux From Scratch 中文手册
- linux 网络实验 ftp程序
- Linux命令大全离线版&在线版
- 操作系统共享内存实验
- dos 下运行Linux 命令--gnu_utils
- linux 0.12内核源代码
- linux简易shell C实现
- linux实验报告及心得体会
- 基于GTK的Linux环境下的简易任务管理器
- linux扫雷游戏代码
评论
共有 条评论