partly support getting IPv6 addresses
- gets interface id from ppp - runs odhcpc to get RA and prefix delegation - doesn't do anything useful with the data yetmodule-based-network
parent
339c2d9873
commit
447f068569
@ -0,0 +1,47 @@
|
||||
|
||||
|
||||
(fn write-value [name value]
|
||||
(with-open [fout (io.open name :w)]
|
||||
(when value (fout:write value))))
|
||||
|
||||
(write-value "state" (. arg 2))
|
||||
(write-value "ifname" (. arg 1))
|
||||
|
||||
(fn write-value-from-env [name]
|
||||
(write-value name (os.getenv (string.upper name))))
|
||||
|
||||
(let [wanted
|
||||
[
|
||||
:addresses
|
||||
:aftr
|
||||
:cer
|
||||
:domains
|
||||
:lw406
|
||||
:mape
|
||||
:mapt
|
||||
:ntp_fqdn
|
||||
:ntp_ip
|
||||
:option_1
|
||||
:option_2
|
||||
:option_3
|
||||
:option_4
|
||||
:option_5
|
||||
:passthru
|
||||
:prefixes
|
||||
:ra_addresses
|
||||
:ra_dns
|
||||
:ra_domains
|
||||
:ra_hoplimit
|
||||
:ra_mtu
|
||||
:ra_reachable
|
||||
:ra_retransmit
|
||||
:ra_routes
|
||||
:rdnss
|
||||
:server
|
||||
:sip_domain
|
||||
:sip_ip
|
||||
:sntp_ip
|
||||
:sntp_fqdn
|
||||
]]
|
||||
(each [_ n (ipairs wanted)]
|
||||
(write-value-from-env n)))
|
@ -0,0 +1,20 @@
|
||||
{ stdenv
|
||||
, buildPackages
|
||||
, cmake
|
||||
, fetchFromGitHub
|
||||
, ...} :
|
||||
# let switchDotH = buildPackages.fetchurl {
|
||||
# url = "https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob_plain;f=target/linux/generic/files/include/uapi/linux/switch.h;hb=99a188828713d6ff9c541590b08d4e63ef52f6d7";
|
||||
# sha256 = "15kmhhcpd84y4f45rf8zai98c61jyvkc37p90pcxirna01x33wi8";
|
||||
# name="switch.h";
|
||||
# };
|
||||
stdenv.mkDerivation {
|
||||
src = fetchFromGitHub {
|
||||
owner = "openwrt";
|
||||
repo = "odhcp6c";
|
||||
rev = "bcd283632ac13391aac3ebdd074d1fd832d76fa3";
|
||||
hash = "sha256-jqxr+N1PffWYmF0F6hJKxRLMN5Ht5WpehK1K2HjL+do=";
|
||||
};
|
||||
name = "odhcp6c";
|
||||
nativeBuildInputs = [ cmake ];
|
||||
}
|
Loading…
Reference in New Issue