{"id":13807411,"url":"https://github.com/stcarrez/ada-enet","last_synced_at":"2025-03-04T21:28:59.561Z","repository":{"id":88796662,"uuid":"68963931","full_name":"stcarrez/ada-enet","owner":"stcarrez","description":"Ada Embedded Network Stack","archived":false,"fork":false,"pushed_at":"2025-01-03T14:43:17.000Z","size":406,"stargazers_count":22,"open_issues_count":1,"forks_count":4,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-01-15T07:09:28.839Z","etag":null,"topics":["arm","arp","dhcp","dns","ethernet","ip","ntp","stm32","udp"],"latest_commit_sha":null,"homepage":null,"language":"Ada","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stcarrez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-22T21:32:37.000Z","updated_at":"2025-01-03T14:43:21.000Z","dependencies_parsed_at":"2024-07-14T19:28:16.511Z","dependency_job_id":"406d05ad-6881-4970-a4a0-b9ae36dc7013","html_url":"https://github.com/stcarrez/ada-enet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcarrez%2Fada-enet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcarrez%2Fada-enet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcarrez%2Fada-enet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcarrez%2Fada-enet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stcarrez","download_url":"https://codeload.github.com/stcarrez/ada-enet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241924447,"owners_count":20043217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","arp","dhcp","dns","ethernet","ip","ntp","stm32","udp"],"created_at":"2024-08-04T01:01:25.188Z","updated_at":"2025-03-04T21:28:59.531Z","avatar_url":"https://github.com/stcarrez.png","language":"Ada","funding_links":[],"categories":["Hardware and Embedded"],"sub_categories":["Communication"],"readme":"# Ada Embedded Network Stack\n\n[![Alire](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/enet.json)](https://alire.ada.dev/crates/enet.html)\n[![Build with Alire](https://github.com/stcarrez/ada-enet/actions/workflows/alire.yml/badge.svg)](https://github.com/stcarrez/ada-enet/actions/workflows/alire.yml)\n[![Build Status](https://img.shields.io/jenkins/s/http/jenkins.vacs.fr/Ada-Enet.svg)](http://jenkins.vacs.fr/job/Ada-Enet/)\n[![License](http://img.shields.io/badge/license-APACHE2-blue.svg)](LICENSE)\n\nThis library is a modular network stack that implements ARP, IPv4, UDP,\nDNS, and DHCP protocols on top of an Ethernet driver. It is divided into\ntwo parts: a hardware-independent core and a specific driver for STM32F7xx\nand STM32F4xx boards. This allows you to provide IPv4 network access to your\nproject with ease. The library is utilized by the EtherScope project to\ncapture and analyze network traffic (See\nhttps://github.com/stcarrez/etherscope).\n\nThe following protocols are supported:\n\n* IPv4 ([RFC 791](https://tools.ietf.org/html/rfc791))\n* ICMP ([RFC 792](https://tools.ietf.org/html/rfc792))\n* UDP ([RFC 768](https://tools.ietf.org/html/rfc768))\n* ARP ([RFC 826](https://tools.ietf.org/html/rfc826))\n* DNS ([RFC 1035](https://tools.ietf.org/html/rfc1035))\n* DHCPv4 ([RFC 2131](https://tools.ietf.org/html/rfc2131))\n* NTP ([RFC 5905](https://tools.ietf.org/html/rfc5905))\n\n## Installation and Usage\n\nThe core part has no dependencies, while the STM32 driver depends on\nthe [ethernet](https://github.com/reznikmm/ethernet) crate, as it implements\nthe MDIO interface defined there.\n\nTo use the library with Alire just run `alr with enet` (for the core part).\nTo use the STM32 driver run `alr with enet_stm32`.\n\nSee more details on [the Wiki](https://github.com/stcarrez/ada-enet/wiki).\n\n## Examples\n\nWe provide a simple [ping_text_io](demos/ping_text_io/) demo. This demo is\nindependent of any particular board, and you can build it by providing the\nrequired runtime, for example:\n\n```shell\nalr -C demos/ping_text_io/ build -- -XRUNTIME=embedded-stm32f746disco\n```\n\nWhen you flash the executable, the board will receive an IP address via DHCP\nand ping the default gateway. You can see the ping messages emitted using the\nstandard Ada.Text_IO routines.\n\nFour additional demo applications are provided to illustrate how you can use\nthe different network features. They require an STM32F429, STM32F746, or\nSTM32F769 Discovery board to run. These examples depend on the\n[Ada_Drivers_Library](https://github.com/AdaCore/Ada_Drivers_Library.git) and\ndo not use Alire for building. Instead, make sure you have the GNAT ARM cross\ntoolchain in your `PATH`, then run:\n\n```shell\nconfigure --with-board=stm32f746 # or stm32f769 or stm32f429\n```\n\nThen, execute `make checkout` to download the necessary dependencies.\nFinally, `make all` will build all four demos.\n\nThe demo applications use the [DHCP Client](https://github.com/stcarrez/ada-enet/wiki/Net_DHCP)\nto get an IPv4 address and obtain the default gateway and DNS.\n\nFor some demo applications, you can switch to a static IP configuration by editing the file\n**demos/utils/demo.adb** and un-comment and modify the following lines:\n\n```ada\n   Ifnet.Ip := (192, 168, 1, 2);\n   Ifnet.Gateway := (192, 168, 1, 240);\n   Ifnet.Dns := (192, 168, 1, 240);\n```\n\nand disable the DHCP configuration by commenting the line:\n\n```ada\n   -- Dhcp.Initialize (Ifnet'Access);\n```\n\n## Ping\n\nThe ping application implements a simple ping on several hosts and displays\nthe ping counters on the STM32F LCD display.  The application will also answer\nto ping requests.\n\nTo build the Ping application you may run:\n\n```shell\n  make ping\n```\n\nAnd to flash the ping image, you can use:\n\n```shell\n  make flash-ping\n```\n\n## Echo\n\nThe echo application shows a simple UDP server that echos the received packet (RFC 862).\nIt listens on UDP port 7, loops to wait for UDP packets, returns them and increment a\ncounter of received packets which is displayed on the STM32 LCD display.\nThe echo application is described in the article: [Simple UDP Echo Server on STM32F746](http://blog.vacs.fr/vacs/blogs/post.html?post=2016/12/04/Simple-UDP-Echo-Server-on-STM32F746)\n\nTo build the Echo application you may run:\n\n```shell\n  make echo\n```\n\nAnd to flash the echo image, you can use:\n\n```shell\n  make flash-echo\n```\n\nAnd to test the echo UDP server, you may use the **socat** command on GNU/Linux.\nFor example:\n\n```shell\n  echo -n 'Hello! Ada is great!' | socat - UDP:192.168.1.156:7\n```\n\n## DNS\n\nThe dns application shows a simple DNS client resolver that queries a DNS to resolve a list\nof hosts. \n\nTo build the dns application you may run:\n\n```shell\n  make dns\n```\n\nAnd to flash the dns image, you can use:\n\n```shell\n  make flash-dns\n```\n\n## Time\n\nThe time application uses the NTP client to retrieve the GMT date from a NTP server\nand it displays the GMT time as soon as the NTP synchronisation is obtained.\nThe application will also answer to ping requests.\n\nTo build the Time application you may run:\n\n```shell\n  make time\n```\n\nAnd to flash the time image, you can use:\n\n```shell\n  make flash-time\n```\n\n## Documentation\n\n- https://github.com/stcarrez/ada-enet/wiki\n- [NTP Client](https://github.com/stcarrez/ada-enet/wiki/Net_NTP)\n- [DHCP Client](https://github.com/stcarrez/ada-enet/wiki/Net_DHCP)\n- [Using the Ada Embedded Network STM32 Ethernet Driver](http://blog.vacs.fr/vacs/blogs/post.html?post=2016/09/29/Using-the-Ada-Embedded-Network-STM32-Ethernet-Driver)\n- [Simple UDP Echo Server on STM32F746](http://blog.vacs.fr/vacs/blogs/post.html?post=2016/12/04/Simple-UDP-Echo-Server-on-STM32F746)\n\n## License\n\n[Apache-2.0](LICENSE.txt) © Stephane Carrez\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstcarrez%2Fada-enet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstcarrez%2Fada-enet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstcarrez%2Fada-enet/lists"}