Skip to content

Instantly share code, notes, and snippets.

View DanielG's full-sized avatar

Daniel Gröber (dxld) DanielG

View GitHub Profile
@DanielG
DanielG / RAcd.org
Last active September 10, 2023 21:48
[DESIGN] RAcd -- Extensible IPv6 Router Advertisement Client Daemon

I’ve grown increasingly weary of the many sharp edges in the Linux kernel implementation of IPv6 router-advertisements for challanging use-cases.

This userspace daemon takes over responsibility for receiving RAs, fixes a lot of the problems and goes back to the good’ol unix ways of composibility and portability in the process.

Architecture

The main RAcd process does just one thing. It receives ICMPv6

/----------------------------------------------------------------------------\
| |
| yosys -- Yosys Open SYnthesis Suite |
| |
| Copyright (C) 2012 - 2020 Claire Xenia Wolf <claire@yosyshq.com> |
| |
| Permission to use, copy, modify, and/or distribute this software for any |
| purpose with or without fee is hereby granted, provided that the above |
| copyright notice and this permission notice appear in all copies. |
@DanielG
DanielG / gist:422d495c4bc90bb9a74e5804e2a6baec
Last active July 31, 2023 17:21
tundra-nat64 warnings
rm src/*.o
rm src/*.d
rm *.8
rm: cannot remove '*.8': No such file or directory
make: [Makefile:47: clean] Error 1 (ignored)
cc -MD -MP -std=c11 -Wall -Wextra -Wpedantic -fanalyzer -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wformat-security -Wnull-dereference -Wstack-protector -Wtrampolines -Walloca -Wvla -Warray-bounds=2 -Wimplicit-fallthrough=3 -Wtraditional-conversion -Wshift-overflow=2 -Wcast-qual -Wstringop-overflow=4 -Wconversion -Warith-conversion -Wlogical-op -Wduplicated-cond -Wduplicated-branches -Wformat-signedness -Wshadow -Wstrict-overflow=4 -Wundef -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wstack-usage=1000000 -Wcast-align=strict -O3 -flto -pthread -fstack-protector-strong -fstack-clash-protection -fPIE -fsanitize=bounds -fsanitize-undefined-trap-on-error -D_FORTIFY_SOURCE=3 -o src/t64_checksum.o -c src/t64_checksum.c
src/t64_checksum.c: In function ‘t64f_checksum__calculate_ipv4_header_checksum’:
src/t64_checksum.c:35:12: warning: conversion from ‘int’ to ‘uint16_t’ {aka ‘
@DanielG
DanielG / .gitattributes
Last active January 24, 2021 11:04
Example of automatically embedding git commit info into source tarballs
/git.mk export-subst
@DanielG
DanielG / GSoC19-final.md
Created August 25, 2019 20:38
Final GSoC19 Report for: A stronger foundation for interactive Haskell tooling

Final GSoC19 Report for: A stronger foundation for interactive Haskell tooling

Throughout the summer I've been working on ecosystem improvements in order to allow Haskell tooling initiatives, mainly Haskell-IDE-Engine, to unfurl their whole potential.

Here we're going to look at what work was done during the summer and how that relates to the original proposal (pdf). The proposal had this

@DanielG
DanielG / lexer.hs
Created June 28, 2019 19:09 — forked from wz1000/lexer.hs
{-# LINE 1 "templates/GenericTemplate.hs" #-}
...
alexIndexInt16OffAddr (AlexA# arr) off =
#ifdef WORDS_BIGENDIAN
narrow16Int# i
where
i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)
high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
low = int2Word# (ord# (indexCharOffAddr# arr off'))
off' = off *# 2#
(setq-default
visual-line-fringe-indicators
'(left-curly-arrow right-curly-arrow))
(define-minor-mode dxld-visual-line-mode
(if dxld-visual-line-mode
(progn
(visual-line-mode -1)
(adaptive-wrap-prefix-mode -1)
)
#!/usr/bin/env runhaskell
-- Copyright (C) 2018 Daniel Gröber <dxld@darkboxed.org>
--
-- Copying and distribution of this file, with or without modification,
-- are permitted in any medium without royalty provided the copyright
-- notice and this notice are preserved. This file is offered as-is,
-- without any warranty.
{-|
License: GNU All-Permissive License
;; Open terminal in current default-directory
(require 'cl)
;; returns '(method user host path)
(defun dxld-parse-tramp-path (path)
(with-temp-buffer
(insert path)
(goto-char (point-min))
(if (condition-case nil
@DanielG
DanielG / Lib.hs
Last active February 26, 2018 14:40
cabal-new-build-then-haddock-repro
module Lib where
foo = 123