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
680
ネットワーク機器の中の OCaml
第五回関数型プログラミング(仮)の会発表スライド
Masayuki Mizuno
January 25, 2024
Tweet
Share
More Decks by Masayuki Mizuno
See All by Masayuki Mizuno
RubyでSlackのbotを作ろう
fetburner
0
100
継続オペレータの話
fetburner
0
150
Rubyでリストモナドを使う
fetburner
0
130
次世代のプロファイラVernierを試す
fetburner
0
95
数値計算とメモリ最適化
fetburner
0
200
3/14なので円周率を計算する
fetburner
0
370
Gotanda.rb#56
fetburner
0
98
遅延評価を使ってOSSのバグを修正した話
fetburner
1
220
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
693
190k
Designing for Performance
lara
604
68k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Speed Design
sergeychernyshev
25
670
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Practical Orchestrator
shlominoach
186
10k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Six Lessons from altMBA
skipperchong
27
3.5k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Music & Morning Musume
bryan
46
6.2k
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.