LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-28-2014, 05:31 AM   #1
atelszewski.versades
Member
 
Registered: Oct 2014
Posts: 61

Rep: Reputation: Disabled
Strategy for network configuration on embedded Linux device (without GUI) from C


Hi,

I'm working on a device that will be connected to a network using WiFi and/or Ethernet. The device itself will not have a user interface that would allow to input the networking configuration. Instead, the configuration is going to be done over serial link, from another device.

I would like to ask you for suggestions on how to do the actual implementation. What I mean is that, there will be a daemon (written in C) that will talk over the serial link (not only for network configuration, but for other messages too) and from this daemon the network has to be configured and brought up.

The ideas I come up with so far are the following:
1) write everything in C,
2) use iwconfig, ifconfig, route, etc. together with some form of exec*,
3) modify the on-disk networking configuration files and restart the networking,
4) use something like NetworkManager and talk to it.

I have to be able to configure all the networking parameters, check what is the link status, use DHCP, provide the available wireless networks list, provide error cause if something is wrong, and so on. And I really would like to go without parsing the strings from standard networking commands.

Any ideas appreciated!

--
Best regards,
Andrzej Telszewski
 
Old 10-28-2014, 05:49 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
I found the Serial HOWTO helpful when I used it in 1999. Options 2 or 3 look better to me.
 
Old 10-30-2014, 01:49 AM   #3
atelszewski.versades
Member
 
Registered: Oct 2014
Posts: 61

Original Poster
Rep: Reputation: Disabled
Hi,

Quote:
I found the Serial HOWTO helpful
I don't have problems with the serial port - and I don't want to run the network over serial port.


In fact, let's forget about the serial port. The question is: how do you configure and manage the Linux network configuration from C program?

As of now, I'm thinking of using NetworkManager, taking nmcli as example code base. What do you think?

--
Best regards,
Andrzej Telszewski
 
Old 12-31-2014, 01:54 AM   #4
atelszewski.versades
Member
 
Registered: Oct 2014
Posts: 61

Original Poster
Rep: Reputation: Disabled
Hi,

Finally I used Network Manager, using the nmcli source code as source of examples. It's quite nice, with the exception that I had to struggle with glib's main loop (my application is written using pthreads) and also not all the gobjects have setters/getters, which I don't like very much.

The version of Network Manager I used was 0.9.10 as it has the possibility to add connection configuration without actually writing anything to the disk, which was important because the device's disk (MMC card) is mounted read-only and the device's configuration is kept in external SPI EEPROM.

--
Best regards,
Andrzej Telszewski
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ifconfig configuration changes are not reflected in the network configuration GUI nkd Linux - Networking 4 12-25-2008 01:17 PM
RHEL Gnome GUI Network Configuration tool pellicle Linux - Networking 3 07-16-2008 11:16 AM
Rhl 9.0 Some Gui Tools Not Loading (example, Network Configuration mytheenbava Red Hat 6 10-22-2007 02:42 AM
network configuration GUI based tool in Debian linian Linux - Networking 2 07-26-2006 09:38 PM
GUI based network configuration tools!!! AskMe Linux - Networking 4 06-28-2004 06:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration