# HBDInetd
**Repository Path**: HybridOS2/HBDInetd
## Basic Information
- **Project Name**: HBDInetd
- **Description**: The daemon managing the network interfaces for HybridOS.
- **Primary Language**: C
- **License**: GPL-3.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-05-24
- **Last Updated**: 2024-05-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# HBDInetd
The daemon managing network interfaces for HybridOS.
## Dependencies
- Linux WPA/WPA2/IEEE 802.1X Supplicant (2.10+):
+ Package on Ubuntu 22.04 LTS: `wpasupplicant`.
+ Source:
- PurC (0.9.13+):
- HBDBus (2.0.0+):
For the detailed information about the 3rd-party dependencies of HBDInetd, please refer to:
## Building
HBDInetd provides two ports:
- `Linux`: This port uses `wpa_supplicant` and a real implementation of DHCP client to
scan, connect, and configure a wireless device. We use this port in a real production.
- `Fake`: This port simulating a virtual wireless device (`wlan0`). We use this port
when we develop an HVML app which provides the UIs for WiFi settings.
When you configure this porject by using CMake, please use one of the following commands
according to your need:
```console
$ cmake -DPORT=Linux
```
Or,
```console
$ cmake -DPORT=Fake
```
## Usage
After building HBDInetd, there will be one executable and the following HVML scripts:
1. `hbdinetd`, located in the `sbin/` directory in the root of your building tree.
This is the daemon program of HBDInetd.
1. `scan.hvml`, located in the `hvml/` directory in the root of your building tree.
This is a HVML program for demonstrating how to use the data bus APIs to scan
the hotspots and get the scan result from HBDInetd.
1. `connect.hvml`, located in the `hvml/` directory in the root of your building tree.
This is a HVML program for demonstrating how to use the data bus APIs to connect to a hotspot.
Note that you can pass the SSID and passphrase on the command line as a query string:
1. `disconnect.hvml`, located in the `hvml/` directory in the root of your building tree.
This is a HVML program for demonstrating how to use the data bus APIs to check the current
wireless connection information and disconnect from a hotspot.
1. `config.hvml`, located in the `hvml/` directory in the root of your building tree.
This is a HVML program for demonstrating how to use the data bus APIs to configure a network interface via DHCP.
```console
$ hvml/connect.hvml -a cn.fmsoft.hybridos.settings -r wifi -q 'ssid=YourSSID&key=ThePassphrase'
```
To start HBDInetd, make sure that you have started HBDBus. For more information
about HBDBus, please refer to:
After starting `hbdbusd`, you can run `hbdinetd` in the root of your building tree:
```console
$ sbin/hbdinetd
```
For the detailed usage, please run `hbdinetd` with `-h` option.
If you use Linux port, please note the following things:
1. Run `sbin/hbdinetd` as a super user (root).
1. Run `rfkill` command to cancel any blocking on the wireless devices.
1. The Linux port also needs that the executable of `wpa_supplicant` is located in the system directory `/sbin/`.
1. Some Linux distribution may configured `wpa_supplicant` under the option `ONFIG_NO_CONFIG_WRITE=y`.
This will prevent the daemon from saving configuration to the default config file.
However, HBDInetd needs this options having value `n`, that is, we hope `wap_supplicant` to manage the configuration.
For the description of APIs providing by HBDInetd, please refer to:
[Design of HybridOS Data Bus (Chinese)](https://github.com/HybridOS2/Documents/blob/master/zh/hybridos-design-data-bus-zh.md)
[Design of HybridOS Network Device Management Daemon (Chinese)](https://github.com/HybridOS2/Documents/blob/master/zh/hybridos-design-sysapp-inetd-zh.md)
## Copying
Copyright (C) 2020 ~ 2023 [FMSoft Technologies]
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
## Tradmarks
1) 飛漫

2) FMSoft

3) 合璧



4) HybridOS

5) HybridRun

6) MiniGUI

7) xGUI

8) miniStudio

9) HVML

10) 呼噜猫

11) Purring Cat

12) PurC

[Beijing FMSoft Technologies Co., Ltd.]: https://www.fmsoft.cn
[FMSoft Technologies]: https://www.fmsoft.cn
[FMSoft]: https://www.fmsoft.cn
[HybridOS Official Site]: https://hybridos.fmsoft.cn
[HybridOS]: https://hybridos.fmsoft.cn
[HVML]: https://github.com/HVML
[Vincent Wei]: https://github.com/VincentWei
[MiniGUI]: https://github.com/VincentWei/minigui