openwrt

Add an option under a specific section using UCI's C API

寵の児 提交于 2019-12-12 04:22:55
问题 How can I add a NEW option under a specific section in an UCI config file? I would like to achieve that programmatically using the C API. Can someone put an example here ? 回答1: #include <uci.h> #include <stdio.h> int main() { uci_context* ctx = uci_alloc_context(); if (!ctx) { printf("failed to alloc uci ctx\n"); return 1; } uci_ptr config; char section_name[] = "your_package.your_section"; if (uci_lookup_ptr(ctx, &config, section_name, true) != UCI_OK || !config.s) { printf("failed to find

MySQL - Can't Log In - Access Denied - Brand New Installation (OpenWRT)

怎甘沉沦 提交于 2019-12-12 03:14:12
问题 I installed MySql on OpenWRT successfully without any errors - see below but I am having issues logging in - it's telling me access denied. But according to everything I found on the Internet, the default user name is root and there is no password so I must be a special case. Please take a look below: root@OpenWrt:~# mysql_install_db Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for

OpenWrt LibUbi implementation

天大地大妈咪最大 提交于 2019-12-12 02:18:17
问题 i'm trying to develop an application (written in ANSI C) for an OpenWrt router using libuci. I've read this useful post: How to find out if the eth0 mode is static or dhcp? and i've develop a piece of my application that is able to read network data (in this case i read if ppp is enabled) using uci library. char path[]="network.ppp.enabled"; struct uci_ptr ptr; struct uci_context *c = uci_alloc_context(); if(!c) return; if (strcmp(typeCmd, "GET") == 0){ if ((uci_lookup_ptr(c, &ptr, path, true

How to get IP and MAC address in my C program for connected Wi-Fi user?

孤人 提交于 2019-12-12 02:03:32
问题 I try to create client application that can be installed into Wi-Fi Router(OpenWRT Attitude Adjustment 12.09) Application must be written in C and implement OpenWRT daemon approach. When any visitor turns Wi-Fi and connects to my SSID I need use his IP and MAC address in my C program. How can I get IP and MAC address in my C program for any new connected users(devise)? I started to try use arp command for any IP which already connected to router: #include <stdio.h> #include <stdlib.h>

How to run openwrt for ppc on qemu?

為{幸葍}努か 提交于 2019-12-11 21:27:39
问题 I need to test some compiled files for MPC8377EWLANA And i don't have hardware yet Any one knows how to run openwrt on qemu-ppc or may be on some other virtual machine? 回答1: For arm you can Run like this qemu-system-arm -M realview-eb-mpcore -kernel openwrt-realview-vmlinux.elf -net nic -net user -nographic similarway you can try qemu-system-ppc -M (machine) -kernel (kernel image) -net nic -net user -nographic 来源: https://stackoverflow.com/questions/18890866/how-to-run-openwrt-for-ppc-on-qemu

How to find two values in file and use theese as variables?

强颜欢笑 提交于 2019-12-11 19:17:45
问题 How can I find and store as variables the two numbers followed by "RX bytes:" and "TX bytes:" in this file? I want to calculate with theese values in a simple current bandwidth monitor bash script using an OpenWrt router. /dev/band1: br-lan Link encap:Ethernet HWaddr inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3848954 errors:0 dropped:21234 overruns:0 frame:0 TX packets:4213574 errors:0 dropped:0 overruns:0 carrier:0

iperf 测试 NAT 性能的方法

狂风中的少年 提交于 2019-12-11 11:27:53
iperf 测试 NAT 性能的方法 openwrt 设备上配nat,主要是配置openwrt设备上的路由芯片的硬件的nat转发性能。在openwrt 页面上做如下操作进行配置。 openwrt上的配置 Network–Firewall–Port Forwards Name 11, protocol tcp+udp,external zone wan ,external port:12345 internal zone:lan,internal ip address: 192.168.1.54, internal port:12345。 网口配置静态ip地址: network–interfaces–wan–edit protocol:Static address IPv4 address:192.168.10.25 IPv4 netmask:255.255.255.0 IPv4 gateway:192.168.10.254 拓扑 一台电脑连被测设备的外网网口,另一台设备连lan口,其中一台做为客户端,一台做为服务端。 分别在服务器端和客户端键入命令 服务端 //-s 表示服务端 -p表示端口 -i时间间隔 -M 可以查看帮助 iperf -s -p 12345 -i 1 -M //在内网执行 测试一次插lan口。 当时测试应该是可以达到500多兆吧。 获取服务端的ip地址

OpenSSL server on OpenWRT router fails handshakes after time and requires a reboot to work again

≡放荡痞女 提交于 2019-12-11 04:27:55
问题 Okay, I admit this is the weirdest openssl question I have ever seen - but what could be causing a problem that only a REBOOT fixes for OpenSSL? The basics are that we have a MITM style SSL proxy on an OpenWRT router. The code works great for hours, and then for some unknown reason (nothing in dmesg or logread) we start getting client handshake failures where openssl just hangs on SSL_ERROR_WANT_READ . We do use edge triggered epoll but as I said, the code works for HOURS without issue. Then

解决Openwrt版本内核不兼容

怎甘沉沦 提交于 2019-12-10 19:04:36
Configuring luci-i18n-firewall-zh-cn. Collected errors: * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-nfs: * kernel (= 4.9.91-1-d882c8d0bcc953d0c9f6cc520732d071) * kernel (= 4.9.91-1-d882c8d0bcc953d0c9f6cc520732d071) * kernel (= 4.9.91-1-d882c8d0bcc953d0c9f6cc520732d071) * * opkg_install_cmd: Cannot install package kmod-fs-nfs. * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-nfs-v3: * kernel (= 4.9.91-1-d882c8d0bcc953d0c9f6cc520732d071) * * opkg_install_cmd: Cannot install package kmod-fs-nfs-v3. * satisfy_dependencies_for:

Cross compiling Gnu Radio for Openwrt

别等时光非礼了梦想. 提交于 2019-12-10 15:54:50
问题 I'm attempting to install Gnu Radio on OpenWRT "Attittude Adjustment" (latest trunk sources). I've cross compiled GR and everything seems to have compiled and linked just fine. However, importing the module in Python results in the following: root@OpenWrt:/usr/lib/python2.7/dist-packages/gnuradio/gr# python Python 2.7.3 (default, Jul 21 2012, 17:36:54) [GCC 4.6.3 20120201 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from gnuradio import gr