Analyse: 64-Bit-Kompatibilitaetsprobleme #5

Open
ppfeiffer wants to merge 2 commits from analysis/64bit-compatibility into master
Owner

Zusammenfassung

Systematische Untersuchung aller Quelldateien auf Probleme die auf 64-Bit-Systemen (LP64: long=8 Byte, pointer=8 Byte) auftreten, auf 32-Bit aber nicht.

Kritische Befunde

LONG/ULONG falsch dokumentiert

typedef unsigned long ULONG; /* 32 Bit */ — der Kommentar ist auf 64-Bit falsch. long ist dort 8 Byte. Betrifft alle Strukturen die ULONG verwenden.

Binaere Inkompatibilitaet der Statistikdateien

Drei Strukturen werden direkt per fwrite/fread gespeichert und enthalten ULONG/time_t:

  • STAT (MH-Tabelle): ~68 Byte (32-Bit) vs ~128 Byte (64-Bit)
  • PORTSTAT: 38 Byte vs 66 Byte
  • TGRAPH: proportional ~2x groesser

Eine auf einem System geschriebene .STA-Datei kann auf dem anderen nicht korrekt gelesen werden.

Warnungen

  • l3rtt.c:220: Zeiger als ULONG uebergeben — funktioniert zufaellig
  • strlen()int-Cast an mehreren Stellen

Inhalt

  • doc/64bit_kompatibilitaet.md: Vollstaendige Analyse mit Loesungsvorschlaegen
  • doc/install_uebersicht.md: Dokumentation der Makefile-Installationsziele

Test plan

  • Dokumente lesen und Befunde nachvollziehen
  • sizeof(ULONG) auf Zielsystem pruefen: printf("%zu\n", sizeof(unsigned long))
  • Entscheiden ob ULONG auf uint32_t migriert werden soll (bricht .STA-Kompatibilitaet)

🤖 Generated with Claude Code

## Zusammenfassung Systematische Untersuchung aller Quelldateien auf Probleme die auf 64-Bit-Systemen (LP64: `long`=8 Byte, `pointer`=8 Byte) auftreten, auf 32-Bit aber nicht. ## Kritische Befunde ### LONG/ULONG falsch dokumentiert `typedef unsigned long ULONG; /* 32 Bit */` — der Kommentar ist auf 64-Bit **falsch**. `long` ist dort 8 Byte. Betrifft alle Strukturen die ULONG verwenden. ### Binaere Inkompatibilitaet der Statistikdateien Drei Strukturen werden direkt per `fwrite`/`fread` gespeichert und enthalten `ULONG`/`time_t`: - `STAT` (MH-Tabelle): ~68 Byte (32-Bit) vs ~128 Byte (64-Bit) - `PORTSTAT`: 38 Byte vs 66 Byte - `TGRAPH`: proportional ~2x groesser Eine auf einem System geschriebene `.STA`-Datei kann auf dem anderen **nicht korrekt gelesen werden**. ## Warnungen - `l3rtt.c:220`: Zeiger als ULONG uebergeben — funktioniert zufaellig - `strlen()` → `int`-Cast an mehreren Stellen ## Inhalt - `doc/64bit_kompatibilitaet.md`: Vollstaendige Analyse mit Loesungsvorschlaegen - `doc/install_uebersicht.md`: Dokumentation der Makefile-Installationsziele ## Test plan - [ ] Dokumente lesen und Befunde nachvollziehen - [ ] `sizeof(ULONG)` auf Zielsystem pruefen: `printf("%zu\n", sizeof(unsigned long))` - [ ] Entscheiden ob ULONG auf `uint32_t` migriert werden soll (bricht .STA-Kompatibilitaet) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
C-Backend (src/l1httpd.c, include/l1httpd.h):
- Neuer MIME-Typ MIME_JSON (application/json) in l1httpd.h
- Enum h_mimetype um JSON-Wert erweitert
- Neuer API-Endpunkt GET /api/status liefert Knotenstatus als JSON
  (Rufzeichen, freie/maximale Buffer)
- Infrastruktur für weitere /api/-Endpunkte vorbereitet
  (PutJsonStatus, PutJsonError, zentraler /api/-Branch in TcpipHttpd)
- h_mimetype wird automatisch auf JSON gesetzt wenn URI mit /api/ beginnt

Frontend (httpd/index.html):
- unescape() durch decodeURIComponent() ersetzt (deprecated API)
- Zwei separate $(document).ready()-Blöcke zu einem zusammengeführt
- Doppelte Form-ID "frm" bereinigt, Formular-ID auf "cmdform" geändert
- "Aktuell" nutzt jetzt GET /api/status und zeigt strukturierte Tabelle
- "Nodes" und "Statistiken" Menüeinträge implementiert (cmd n / cmd st)
- Fehlerbehandlung für alle AJAX-Aufrufe ergänzt
- encodeURIComponent() für Benutzereingaben in der Befehlszeile

Dokumentation:
- doc/httpd_verbesserungen.md: Analyse und Verbesserungsübersicht

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Untersucht alle Quelldateien auf Probleme die spezifisch auf 64-Bit-Systemen
(LP64: long=8Byte, pointer=8Byte) auftreten, auf 32-Bit aber nicht.

Wesentliche Befunde:

- KRITISCH: LONG/ULONG sind typedef auf 'long' (Kommentar sagt faelschlich
  "32 Bit"), auf 64-Bit tatsaechlich 8 Byte gross
- KRITISCH: Binaere Inkompatibilitaet der .STA-Statistikdateien und
  Graph-Dateien: STAT, PORTSTAT und TGRAPH enthalten ULONG/time_t und
  werden per fwrite/fread direkt gespeichert - Dateien zwischen 32-Bit
  und 64-Bit-Systemen sind nicht austauschbar
- WARNUNG: Zeiger als ULONG uebergeben (l3rtt.c:220) - funktioniert
  zufaellig, weil sizeof(ULONG)==sizeof(pointer) auf 64-Bit
- WARNUNG: strlen() Rueckgabewert (size_t) in int gespeichert

Zusaetzlich: doc/install_uebersicht.md hinzugefuegt (Makefile install-Ziele)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin analysis/64bit-compatibility:analysis/64bit-compatibility
git switch analysis/64bit-compatibility

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff analysis/64bit-compatibility
git switch analysis/64bit-compatibility
git rebase master
git switch master
git merge --ff-only analysis/64bit-compatibility
git switch analysis/64bit-compatibility
git rebase master
git switch master
git merge --no-ff analysis/64bit-compatibility
git switch master
git merge --squash analysis/64bit-compatibility
git switch master
git merge --ff-only analysis/64bit-compatibility
git switch master
git merge analysis/64bit-compatibility
git push origin master
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ppfeiffer/tnn179test!5
No description provided.