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
670
ネットワーク機器の中の OCaml
第五回関数型プログラミング(仮)の会発表スライド
Masayuki Mizuno
January 25, 2024
Tweet
Share
More Decks by Masayuki Mizuno
See All by Masayuki Mizuno
RubyでSlackのbotを作ろう
fetburner
0
90
継続オペレータの話
fetburner
0
120
Rubyでリストモナドを使う
fetburner
0
120
次世代のプロファイラVernierを試す
fetburner
0
91
数値計算とメモリ最適化
fetburner
0
180
3/14なので円周率を計算する
fetburner
0
360
Gotanda.rb#56
fetburner
0
93
遅延評価を使ってOSSのバグを修正した話
fetburner
1
220
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
We Have a Design System, Now What?
morganepeng
50
7.2k
Making Projects Easy
brettharned
115
5.9k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Why Our Code Smells
bkeepers
PRO
334
57k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.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.