# microsoft/quicreach architecture

> Architecture diagram of the GitHub repository microsoft/quicreach, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/quicreach
- Repository: https://github.com/microsoft/quicreach

## Overview

##### Project type and purpose
- quicreach is a native C++ command-line tool that tests QUIC reachability of one or more hosts.
- It ships as a sample application built on top of the MsQuic library (included as a git submodule) and can generate statistics or CSV output.

##### File structure
- Top-level
- .azure, .github – CI/CD and policy configurations for Azure Pipelines and GitHub Actions
- CMakeLists.txt, build.ps1 – build orchestrators
- .gitmodules – pulls in msquic/ as an embedded library
- src/ – application source code and installer definitions
- version.json – version metadata
- src/
- quicreach.cpp – main entry, argument parsing, high-level control flow
- domains.hpp – handles domain list expansion (wildcards) and name resolution
- installer.wxs – Windows MSI installer definition (WiX)
- CI workflows
- build.yml – compile and test
- reach.yml – periodic reachability data collection

##### README for additional insights
- Purpose: run QUIC handshakes (via MsQuic) to determine success/failure, measure RTT and handshake times
- Outputs: console messages, CSV export
- Options: ALPN override, parallel hosts, built-in TLS validation, insecure mode, etc.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Runtime Components"
        CLI["CLI Frontend\n(src/quicreach.cpp)"]:::code
        Domain["Domain Resolver\n(src/domains.hpp)"]:::code
        Tester["Reachability Tester\n(src/quicreach.cpp)"]:::code
        QUIC["MsQuic Library\n(msquic/)"]:::external
        OSNet["OS Network Stack"]:::external
        Output["Output Module\n(src/quicreach.cpp)"]:::code

        CLI -->|"parse arguments"| Domain
        Domain -->|"IP list"| Tester
        Tester -->|"invoke MsQuic API"| QUIC
        QUIC -->|"network calls"| OSNet
        Tester -->|"metrics"| Output
    end

    subgraph "Build & CI/CD"
        CMake["CMakeLists.txt"]:::ci
        SubCMake["src/CMakeLists.txt"]:::ci
        BuildPS["build.ps1"]:::ci
        GitSub[".gitmodules"]:::ci
        Version["version.json"]:::ci
        GitHub["GitHub Actions"]:::ci
        Azure["Azure Pipelines"]:::ci

        CMake -->|includes submodule| GitSub
        CMake --> SubCMake
        CMake --> BuildPS
        CMake --> Version
        GitHub --> CMake
        Azure --> CMake
    end

    subgraph "Installer / Packaging"
        WiX["WiX Definition\n(src/installer.wxs)"]:::ci
        RC["Resource Files\n(src/quicreach.rc, src/quicreach.ver)"]:::ci

        WiX --> RC
    end

    click CLI "https://github.com/microsoft/quicreach/blob/main/src/quicreach.cpp"
    click Domain "https://github.com/microsoft/quicreach/blob/main/src/domains.hpp"
    click Tester "https://github.com/microsoft/quicreach/blob/main/src/quicreach.cpp"
    click QUIC "https://github.com/microsoft/quicreach/tree/main/msquic/"
    click OSNet "https://github.com/microsoft/quicreach/tree/main/msquic/"
    click Output "https://github.com/microsoft/quicreach/blob/main/src/quicreach.cpp"
    click WiX "https://github.com/microsoft/quicreach/blob/main/src/installer.wxs"
    click RC "https://github.com/microsoft/quicreach/blob/main/src/quicreach.rc"
    click RC "https://github.com/microsoft/quicreach/blob/main/src/quicreach.ver"
    click CMake "https://github.com/microsoft/quicreach/blob/main/CMakeLists.txt"
    click SubCMake "https://github.com/microsoft/quicreach/blob/main/src/CMakeLists.txt"
    click BuildPS "https://github.com/microsoft/quicreach/blob/main/build.ps1"
    click GitSub "https://github.com/microsoft/quicreach/blob/main/.gitmodules"
    click Version "https://github.com/microsoft/quicreach/blob/main/version.json"
    click GitHub "https://github.com/microsoft/quicreach/blob/main/.github/workflows/build.yml"
    click GitHub "https://github.com/microsoft/quicreach/blob/main/.github/workflows/onebranch.yml"
    click GitHub "https://github.com/microsoft/quicreach/blob/main/.github/workflows/reach.yml"
    click Azure "https://github.com/microsoft/quicreach/blob/main/.azure/pre-build.ps1"
    click Azure "https://github.com/microsoft/quicreach/blob/main/.azure/post-build.ps1"

    classDef code fill:#D6EAFE,stroke:#1E90FF,color:#000
    classDef external fill:#E6F4EA,stroke:#28A745,color:#000
    classDef ci fill:#FFF4E5,stroke:#FFA500,color:#000
```
