Skip to content

Commit 780b855

Browse files
committed
feat(avahi): Initial avahi port
Note the LGPL license, add a warning!
1 parent 6d19aab commit 780b855

19 files changed

+1616
-2
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "components/mosquitto/mosquitto"]
55
path = components/mosquitto/mosquitto
66
url = https://github.com/eclipse/mosquitto
7+
[submodule "components/avahi/avahi"]
8+
path = components/avahi/avahi
9+
url = https://github.com/avahi/avahi.git

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ repos:
6161
- repo: local
6262
hooks:
6363
- id: commit message scopes
64-
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common, eppp, tls_cxx, mosq, sockutls"
65-
entry: '\A(?!(feat|fix|ci|bump|test|docs|chore)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|tls_cxx|mosq|sockutls)\)\:)'
64+
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common, eppp, tls_cxx, mosq, sockutls, avahi"
65+
entry: '\A(?!(feat|fix|ci|bump|test|docs|chore)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|tls_cxx|mosq|sockutls|avahi)\)\:)'
6666
language: pygrep
6767
args: [--multiline]
6868
stages: [commit-msg]

ci/check_copyright_config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ mosquitto_component:
5555
- Apache-2.0
5656
- BSD-3-Clause
5757

58+
avahi_component:
59+
include:
60+
- 'components/avahi/**'
61+
allowed_licenses:
62+
- LGPL-2.1
63+
- Apache-2.0
64+
- Unlicense OR CC0-1.0
65+
5866
slim_modem_examples:
5967
include:
6068
- 'examples/esp_netif/slip_custom_netif/**'

components/avahi/CMakeLists.txt

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
set(avahi_path "avahi")
2+
set(avahi_core "${avahi_path}/avahi-core")
3+
set(avahi_common "${avahi_path}/avahi-common")
4+
set(avahi_core_SRCS "${avahi_core}/server.c"
5+
"${avahi_common}/error.c"
6+
"${avahi_common}/malloc.c"
7+
"${avahi_common}/simple-watch.c"
8+
"${avahi_common}/domain.c"
9+
"${avahi_common}/timeval.c"
10+
"${avahi_common}/strlst.c"
11+
"${avahi_common}/address.c"
12+
"${avahi_common}/rlist.c"
13+
"${avahi_common}/utf8.c"
14+
"${avahi_core}/log.c"
15+
"${avahi_core}/rr.c"
16+
"${avahi_core}/response-sched.c"
17+
"${avahi_core}/probe-sched.c"
18+
"${avahi_core}/query-sched.c"
19+
"${avahi_core}/rrlist.c"
20+
"${avahi_core}/hashmap.c"
21+
"${avahi_core}/announce.c"
22+
"${avahi_core}/domain-util.c"
23+
"${avahi_core}/multicast-lookup.c"
24+
"${avahi_core}/iface.c"
25+
"${avahi_core}/entry.c"
26+
"${avahi_core}/cache.c"
27+
"${avahi_core}/util.c"
28+
"${avahi_core}/addr-util.c"
29+
"${avahi_core}/timeeventq.c"
30+
"${avahi_core}/querier.c"
31+
"${avahi_core}/browse.c"
32+
"${avahi_core}/dns.c"
33+
"${avahi_core}/wide-area.c"
34+
"${avahi_core}/prioq.c"
35+
"${avahi_core}/fdutil.c"
36+
"${avahi_core}/browse-domain.c"
37+
"${avahi_core}/browse-dns-server.c"
38+
"${avahi_core}/browse-service.c"
39+
"${avahi_core}/resolve-host-name.c"
40+
"${avahi_core}/resolve-address.c"
41+
"${avahi_core}/resolve-service.c"
42+
"${avahi_core}/browse-service-type.c"
43+
# "${avahi_core}/browse-record.c"
44+
# "${avahi_core}/resolve-service-group.c"
45+
# "${avahi_core}/resolve-record.c"
46+
)
47+
48+
idf_component_register(SRCS "avahi-port/iface-esp32.c"
49+
"avahi-port/socket.c"
50+
${avahi_core_SRCS}
51+
INCLUDE_DIRS "avahi-port" "${avahi_core}" "${avahi_path}"
52+
REQUIRES "esp_netif")
53+
54+
target_compile_definitions(${COMPONENT_LIB} PRIVATE "HAVE_CONFIG_H")
55+
# ignore specific warnings on certain files
56+
set_source_files_properties(${avahi_common}/domain.c PROPERTIES COMPILE_FLAGS -Wno-char-subscripts)
57+
set_source_files_properties(${avahi_core}/rr.c PROPERTIES COMPILE_FLAGS -Wno-format)
58+
set_source_files_properties(${avahi_core}/iface.c PROPERTIES COMPILE_FLAGS -Wno-format)
59+
set_source_files_properties(${avahi_core}/entry.c PROPERTIES COMPILE_FLAGS -Wno-format)
60+
set_source_files_properties(${avahi_common}/address.c PROPERTIES COMPILE_FLAGS -Wno-format)

components/avahi/LICENSE.txt

+508
Large diffs are not rendered by default.

components/avahi/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Simple ESP-IDF avahi port
2+
3+
This is a simple port of avahi for ESP-IDF. It is based on the avahi-core library and is intended to be used as a mDNS service browser.
4+
5+
## Warning
6+
7+
This component uses avahi project which is distributed under the LGPL license. This means that you have to provide the source code of your project to the end user if you use this component in your project.
8+
For more details, please refer to the [LICENSE](LICENSE.txt) file.

components/avahi/avahi

Submodule avahi added at 1dade81

0 commit comments

Comments
 (0)