Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ネットワーク機器の中の OCaml
Search
Masayuki Mizuno
January 25, 2024
1
660
ネットワーク機器の中の OCaml
第五回関数型プログラミング(仮)の会発表スライド
Masayuki Mizuno
January 25, 2024
Tweet
Share
More Decks by Masayuki Mizuno
See All by Masayuki Mizuno
継続オペレータの話
fetburner
0
84
Rubyでリストモナドを使う
fetburner
0
95
次世代のプロファイラVernierを試す
fetburner
0
85
数値計算とメモリ最適化
fetburner
0
91
3/14なので円周率を計算する
fetburner
0
330
Gotanda.rb#56
fetburner
0
89
遅延評価を使ってOSSのバグを修正した話
fetburner
1
200
Featured
See All Featured
Speed Design
sergeychernyshev
22
430
Embracing the Ebb and Flow
colly
83
4.4k
Intergalactic Javascript Robots from Outer Space
tanoku
268
26k
Side Projects
sachag
451
42k
Creatively Recalculating Your Daily Design Routine
revolveconf
215
12k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
354
29k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
27
7.4k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Typedesign – Prime Four
hannesfritz
39
2.3k
Building Flexible Design Systems
yeseniaperezcruz
325
38k
Why Our Code Smells
bkeepers
PRO
334
56k
Making the Leap to Tech Lead
cromwellryan
128
8.8k
Transcript
© 2023 Wantedly, Inc. ωοτϫʔΫػثͷதͷ OCaml Jan. 26 2023 -
Masayuki Mizuno (@fetburner)
ࠓ͢͜ͱ © 2023 Wantedly, Inc.
ࠓ͢͜ͱ ؔܕݴޠ OCaml ͕ΘΕ͍ͯΔ OSS ͷհ • ωοτϫʔΫ OS VyOS
VyOS ͰͲͷΑ͏ʹ OCaml ͕ΘΕ͍ͯΔ͔ • ઃఆϑΝΠϧͷॲཧܥ • ͷόϦσʔλ © 2023 Wantedly, Inc. VyOS झຯͰ͍ͬͯΔ͚ͩͰɺۀͷग़͖ͯ·ͤΜ
VyOS ͱ © 2023 Wantedly, Inc.
VyOS ͱ ΦʔϓϯιʔεͷωοτϫʔΫ OS • Debian ϕʔε • Vyatta ແঈ൛ͷϑΥʔΫ
• ϕΞϝλϧ্͚ͩͰͳ͘ɺԾԽج൫Ϋϥυ্Ͱͷಈ࡞αϙʔτ ۀ༻ϧʔλ૬ͷػೳΛඋ͑Δ • OSPFɺBGP4+ ͷϧʔςΟϯάϓϩτίϧ • IPsecɺSSL ʹجͮ͘ VPN ػೳ • VRF-lite ʹΑΔϧʔλԾԽ © 2023 Wantedly, Inc.
VyOS ͷ༻ײ JUNOS ϥΠΫͳ CUI ͰઃఆͰ͖Δ • ϧʔςΟϯάϓϩτίϧ VPNɺՌͯίϯςφ·Ͱ୯ҰͷઃఆϑΝΠϧͰཧ ©
2023 Wantedly, Inc.
OCaml ͕ͲͷΑ͏ʹΘΕ͍ͯΔ͔ © 2023 Wantedly, Inc.
എܠ: VyOS ͷΞʔΩςΫνϟ Linux ͷػߏ OSS ΛΈ߹ΘͤͯछʑͷػೳΛఏڙ • VyOS ͷઃఆϑΝΠϧΛ֤छιϑτͷͦΕʹม
© 2023 Wantedly, Inc. vyconf FRR strongSwan iptables … ݸผͷઃఆϑΝΠϧ VyOS ͷઃఆϑΝΠϧ
ͲͷΑ͏ʹ OCaml ͕ΘΕ͍ͯΔ͔ ઃఆϑΝΠϧͷॲཧܥ • ߏจղੳ AST ͷૢ࡞ͷͨΊͷϥΠϒϥϦ࣮ʹΘΕ͍ͯΔ • ࣮ࡍͷίʔυੜ
OCaml Ͱॻ͔ΕͨϥΠϒϥϦΛͬͯ Python Ͱ࣮ ઃఆͷόϦσʔλ • ೖྗ͕ਖ਼͍͠ IPv6 ΞυϨεʹͳ͍ͬͯΔ͔ • ߴԽͷͨΊʹݩʑ Python Ͱॻ͔Ε͍ͯͨόϦσʔλΛஔ͖͍͑ͯΔ © 2023 Wantedly, Inc.
OCaml Ͱॻ͔ΕͨίʔυΛಡΉ (1/2) © 2023 Wantedly, Inc. ϰΝϦΞϯτΛ׆༻ͯ͠ AST ͕ఆٛ͞Ε͍ͯΔ
https://github.com/vyos/vyconf/blob/dd9271b4304c6b1a5a2576821d1b2b8fd3aa6bf5/src/ vytree.ml#L1-L7
OCaml Ͱॻ͔ΕͨίʔυΛಡΉ (2/2) © 2023 Wantedly, Inc. ύλʔϯϚονΛͬͯ AST ͷૢ࡞͕࣮͞Ε͍ͯΔ
https://github.com/vyos/vyconf/blob/dd9271b4304c6b1a5a2576821d1b2b8fd3aa6bf5/src/ vytree.ml#L22-L30
·ͱΊ © 2023 Wantedly, Inc.
·ͱΊ ωοτϫʔΫ OS ͷ VyOS Ͱ OCaml ͕ΘΕ͍ͯΔ • ઃఆϑΝΠϧͷॲཧܥ
• ֤छͷόϦσʔλ ҙ֎ͳॴʹؔܕݴޠͷً͚Δ໘͕͋Δ • ϰΝϦΞϯτύλʔϯϚονͷԸܙͰݴޠॲཧܥΛ؆୯ʹ࣮Ͱ͖Δͷ͕ڧ͍ • DSL ؚΊΕɺݴޠॲཧܥͷԠ༻ൣғ͍ © 2023 Wantedly, Inc.