# melskiedev/ipv6-pldt-openwrt architecture

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

- Interactive diagram: https://gitdiagram.com/melskiedev/ipv6-pldt-openwrt
- Repository: https://github.com/melskiedev/ipv6-pldt-openwrt

## Overview

This repository is a targeted OpenWrt IPv6 repair and recovery setup for PLDT Fiber in bridge mode. Its main workflow is periodic watchdog health assessment and source-policy correction, with coordinated, bounded recovery when needed; a separate interface-up hook repairs routes and the gateway. The README also names optional GARP, prefix-tracking, and Discord-logging components. Relationships below are limited to those stated in the available README excerpt; source excerpts were unavailable, so undocumented integrations are not inferred.

Main entry points: [`ipv6-watchdog`](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-watchdog) (IPv6 watchdog), [`wan-recovery-common`](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/wan-recovery-common) (Recovery coordinator), [`99-ipv6-setup`](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/99-ipv6-setup) (Interface-up hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_monitor["Health monitoring"]
  node_watchdog["IPv6 watchdog"]
  node_health["Prefix health checks"]
  node_source["Source policy"]
  node_recovery["Recovery escalation"]
end

subgraph group_repair["Network repair"]
  node_common["Recovery coordinator"]
  node_bounds["Recovery limits"]
  node_hotplug["Interface-up hook"]
  node_routefix["Route and gateway repair"]
end

subgraph group_support["Optional support"]
  node_garp["GARP support"]
  node_tracker["Prefix tracker"]
  node_discord["Discord logger"]
  node_discordinit["Logger init script"]
end

node_cron(("Cron scheduler"))

node_cron -->|"runs each minute"| node_watchdog
node_watchdog -->|"decides health"| node_health
node_watchdog -->|"applies policy"| node_source
node_watchdog -->|"escalates faults"| node_recovery
node_recovery -->|"coordinates actions"| node_common
node_common -->|"enforces limits"| node_bounds
node_hotplug -->|"repairs on ifup"| node_routefix

click node_watchdog "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-watchdog"
click node_health "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-watchdog"
click node_source "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-watchdog"
click node_recovery "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-watchdog"
click node_common "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/wan-recovery-common"
click node_bounds "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/wan-recovery-common"
click node_hotplug "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/99-ipv6-setup"
click node_routefix "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/99-ipv6-setup"
click node_garp "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/97-garp"
click node_tracker "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-prefix-tracker"
click node_discord "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-discord-logger"
click node_discordinit "https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/init.d-ipv6-discord-logger"

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_watchdog,node_health,node_source,node_recovery toneBlue
class node_common,node_bounds,node_hotplug,node_routefix toneAmber
class node_garp,node_tracker,node_discord,node_discordinit toneMint
class node_cron toneRose
```

## Components

### Health monitoring

- [IPv6 watchdog](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-watchdog): `ipv6-watchdog`
- [Prefix health checks](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-watchdog): `ipv6-watchdog`
- [Source policy](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-watchdog): `ipv6-watchdog`
- [Recovery escalation](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-watchdog): `ipv6-watchdog`

### Network repair

- [Recovery coordinator](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/wan-recovery-common): `wan-recovery-common`
- [Recovery limits](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/wan-recovery-common): `wan-recovery-common`
- [Interface-up hook](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/99-ipv6-setup): `99-ipv6-setup`
- [Route and gateway repair](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/99-ipv6-setup): `99-ipv6-setup`

### Optional support

- [GARP support](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/97-garp): `97-garp`
- [Prefix tracker](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-prefix-tracker): `ipv6-prefix-tracker`
- [Discord logger](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/ipv6-discord-logger): `ipv6-discord-logger`
- [Logger init script](https://github.com/melskiedev/ipv6-pldt-openwrt/blob/main/init.d-ipv6-discord-logger): `init.d-ipv6-discord-logger`

### Other components

- **Cron scheduler**

## Connections

- Cron scheduler → IPv6 watchdog: runs each minute (evidence: `README.md`)
- IPv6 watchdog → Prefix health checks: decides health (evidence: `README.md`)
- IPv6 watchdog → Source policy: applies policy (evidence: `README.md`)
- IPv6 watchdog → Recovery escalation: escalates faults (evidence: `README.md`)
- Recovery escalation → Recovery coordinator: coordinates actions (evidence: `README.md`)
- Recovery coordinator → Recovery limits: enforces limits (evidence: `README.md`)
- Interface-up hook → Route and gateway repair: repairs on ifup (evidence: `README.md`)
