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
690
ネットワーク機器の中の OCaml
第五回関数型プログラミング(仮)の会発表スライド
Masayuki Mizuno
January 25, 2024
Tweet
Share
More Decks by Masayuki Mizuno
See All by Masayuki Mizuno
RubyでSlackのbotを作ろう
fetburner
0
110
継続オペレータの話
fetburner
0
150
Rubyでリストモナドを使う
fetburner
0
140
次世代のプロファイラVernierを試す
fetburner
0
100
数値計算とメモリ最適化
fetburner
0
200
3/14なので円周率を計算する
fetburner
0
370
Gotanda.rb#56
fetburner
0
100
遅延評価を使ってOSSのバグを修正した話
fetburner
1
240
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
The World Runs on Bad Software
bkeepers
PRO
66
11k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Side Projects
sachag
452
42k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Six Lessons from altMBA
skipperchong
27
3.6k
Optimising Largest Contentful Paint
csswizardry
33
3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
113
50k
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.