# vicenrele/enlace architecture

> Architecture diagram of the GitHub repository vicenrele/enlace, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vicenrele/enlace
- Repository: https://github.com/vicenrele/enlace

## Overview

Enlace is a Windows C application demonstrating OSI-style data-link services. Its documented user workflow is to enter a short phrase in the Morse user application, which uses the link-layer services to communicate between two processes; the application displays invoked service primitives and frame composition. The link layer provides a character-oriented protocol and checksum/CRC error control, with a serial-port simulation beneath it. The README establishes these capabilities, but the source excerpts do not show the runtime calls connecting them, so only its explicit user-application relationship is drawn.

Main entry points: [`morse.c`](https://github.com/vicenrele/enlace/blob/master/morse.c) (Morse application), [`enlace.c`](https://github.com/vicenrele/enlace/blob/master/enlace.c) (Link protocol), [`funciones.c`](https://github.com/vicenrele/enlace/blob/master/funciones.c) (Link services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_user_app["User application"]
  node_morse["Morse application<br/>[morse.c]"]
end

subgraph group_link_layer["Link layer"]
  node_link_services["Link services<br/>[funciones.c]"]
  node_link_protocol["Link protocol<br/>[enlace.c]"]
  node_link_interface["Link interface<br/>[enlace.h]"]
  node_frame_config["Link configuration<br/>[enlace.ini]"]
end

subgraph group_error_control["Error control"]
  node_crc16["CRC-16<br/>[icrc.c]"]
  node_crc_byte["Byte CRC<br/>[icrc1.c]"]
  node_crc_caller["CRC caller<br/>[llamadaCrc.c]"]
end

subgraph group_physical_layer["Physical layer"]
  node_physical_interface["Physical interface<br/>[fisico.h]"]
end

node_user(("User"))
node_peer_process(("Peer process"))

node_user -->|"enters phrase"| node_morse
node_morse -->|"uses services"| node_link_services
node_link_protocol -->|"communicates with"| node_peer_process

click node_morse "https://github.com/vicenrele/enlace/blob/master/morse.c"
click node_link_services "https://github.com/vicenrele/enlace/blob/master/funciones.c"
click node_link_protocol "https://github.com/vicenrele/enlace/blob/master/enlace.c"
click node_link_interface "https://github.com/vicenrele/enlace/blob/master/enlace.h"
click node_frame_config "https://github.com/vicenrele/enlace/blob/master/enlace.ini"
click node_crc16 "https://github.com/vicenrele/enlace/blob/master/icrc.c"
click node_crc_byte "https://github.com/vicenrele/enlace/blob/master/icrc1.c"
click node_crc_caller "https://github.com/vicenrele/enlace/blob/master/llamadaCrc.c"
click node_physical_interface "https://github.com/vicenrele/enlace/blob/master/fisico.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_morse,node_user toneBlue
class node_link_services,node_link_protocol,node_link_interface,node_frame_config toneAmber
class node_crc16,node_crc_byte,node_crc_caller toneMint
class node_physical_interface toneRose
class node_peer_process toneIndigo
```

## Components

### User application

- [Morse application](https://github.com/vicenrele/enlace/blob/master/morse.c): `morse.c`

### Link layer

- [Link services](https://github.com/vicenrele/enlace/blob/master/funciones.c): `funciones.c`
- [Link protocol](https://github.com/vicenrele/enlace/blob/master/enlace.c): `enlace.c`
- [Link interface](https://github.com/vicenrele/enlace/blob/master/enlace.h): `enlace.h`
- [Link configuration](https://github.com/vicenrele/enlace/blob/master/enlace.ini): `enlace.ini`

### Error control

- [CRC-16](https://github.com/vicenrele/enlace/blob/master/icrc.c): `icrc.c`
- [Byte CRC](https://github.com/vicenrele/enlace/blob/master/icrc1.c): `icrc1.c`
- [CRC caller](https://github.com/vicenrele/enlace/blob/master/llamadaCrc.c): `llamadaCrc.c`

### Physical layer

- [Physical interface](https://github.com/vicenrele/enlace/blob/master/fisico.h): `fisico.h`

### Other components

- **User**
- **Peer process**

## Connections

- User → Morse application: enters phrase (evidence: `README.md`)
- Morse application → Link services: uses services (evidence: `README.md`)
- Link protocol → Peer process: communicates with (evidence: `README.md`)
