···11+# Apache License
22+Version 2.0, January 2004
33+44+http://www.apache.org/licenses/
55+66+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
77+88+## 1. Definitions.
99+1010+"License" shall mean the terms and conditions for use, reproduction, and
1111+distribution as defined by Sections 1 through 9 of this document.
1212+1313+"Licensor" shall mean the copyright owner or entity authorized by the copyright
1414+owner that is granting the License.
1515+1616+"Legal Entity" shall mean the union of the acting entity and all other entities
1717+that control, are controlled by, or are under common control with that entity.
1818+For the purposes of this definition, "control" means (i) the power, direct or
1919+indirect, to cause the direction or management of such entity, whether by
2020+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
2121+outstanding shares, or (iii) beneficial ownership of such entity.
2222+2323+"You" (or "Your") shall mean an individual or Legal Entity exercising
2424+permissions granted by this License.
2525+2626+"Source" form shall mean the preferred form for making modifications, including
2727+but not limited to software source code, documentation source, and configuration
2828+files.
2929+3030+"Object" form shall mean any form resulting from mechanical transformation or
3131+translation of a Source form, including but not limited to compiled object code,
3232+generated documentation, and conversions to other media types.
3333+3434+"Work" shall mean the work of authorship, whether in Source or Object form, made
3535+available under the License, as indicated by a copyright notice that is included
3636+in or attached to the work (an example is provided in the Appendix below).
3737+3838+"Derivative Works" shall mean any work, whether in Source or Object form, that
3939+is based on (or derived from) the Work and for which the editorial revisions,
4040+annotations, elaborations, or other modifications represent, as a whole, an
4141+original work of authorship. For the purposes of this License, Derivative Works
4242+shall not include works that remain separable from, or merely link (or bind by
4343+name) to the interfaces of, the Work and Derivative Works thereof.
4444+4545+"Contribution" shall mean any work of authorship, including the original version
4646+of the Work and any modifications or additions to that Work or Derivative Works
4747+thereof, that is intentionally submitted to Licensor for inclusion in the Work
4848+by the copyright owner or by an individual or Legal Entity authorized to submit
4949+on behalf of the copyright owner. For the purposes of this definition,
5050+"submitted" means any form of electronic, verbal, or written communication sent
5151+to the Licensor or its representatives, including but not limited to
5252+communication on electronic mailing lists, source code control systems, and
5353+issue tracking systems that are managed by, or on behalf of, the Licensor for
5454+the purpose of discussing and improving the Work, but excluding communication
5555+that is conspicuously marked or otherwise designated in writing by the copyright
5656+owner as "Not a Contribution."
5757+5858+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
5959+of whom a Contribution has been received by Licensor and subsequently
6060+incorporated within the Work.
6161+6262+## 2. Grant of Copyright License.
6363+6464+Subject to the terms and conditions of this License, each Contributor hereby
6565+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
6666+irrevocable copyright license to reproduce, prepare Derivative Works of,
6767+publicly display, publicly perform, sublicense, and distribute the Work and such
6868+Derivative Works in Source or Object form.
6969+7070+## 3. Grant of Patent License.
7171+7272+Subject to the terms and conditions of this License, each Contributor hereby
7373+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
7474+irrevocable (except as stated in this section) patent license to make, have
7575+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
7676+such license applies only to those patent claims licensable by such Contributor
7777+that are necessarily infringed by their Contribution(s) alone or by combination
7878+of their Contribution(s) with the Work to which such Contribution(s) was
7979+submitted. If You institute patent litigation against any entity (including a
8080+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
8181+Contribution incorporated within the Work constitutes direct or contributory
8282+patent infringement, then any patent licenses granted to You under this License
8383+for that Work shall terminate as of the date such litigation is filed.
8484+8585+## 4. Redistribution.
8686+8787+You may reproduce and distribute copies of the Work or Derivative Works thereof
8888+in any medium, with or without modifications, and in Source or Object form,
8989+provided that You meet the following conditions:
9090+9191+1. You must give any other recipients of the Work or Derivative Works a copy of
9292+ this License; and
9393+9494+2. You must cause any modified files to carry prominent notices stating that
9595+ You changed the files; and
9696+9797+3. You must retain, in the Source form of any Derivative Works that You
9898+ distribute, all copyright, patent, trademark, and attribution notices from
9999+ the Source form of the Work, excluding those notices that do not pertain to
100100+ any part of the Derivative Works; and
101101+102102+4. If the Work includes a "NOTICE" text file as part of its distribution, then
103103+ any Derivative Works that You distribute must include a readable copy of the
104104+ attribution notices contained within such NOTICE file, excluding those
105105+ notices that do not pertain to any part of the Derivative Works, in at least
106106+ one of the following places: within a NOTICE text file distributed as part
107107+ of the Derivative Works; within the Source form or documentation, if
108108+ provided along with the Derivative Works; or, within a display generated by
109109+ the Derivative Works, if and wherever such third-party notices normally
110110+ appear. The contents of the NOTICE file are for informational purposes only
111111+ and do not modify the License. You may add Your own attribution notices
112112+ within Derivative Works that You distribute, alongside or as an addendum to
113113+ the NOTICE text from the Work, provided that such additional attribution
114114+ notices cannot be construed as modifying the License.
115115+116116+You may add Your own copyright statement to Your modifications and may provide
117117+additional or different license terms and conditions for use, reproduction, or
118118+distribution of Your modifications, or for any such Derivative Works as a whole,
119119+provided Your use, reproduction, and distribution of the Work otherwise complies
120120+with the conditions stated in this License.
121121+122122+## 5. Submission of Contributions.
123123+124124+Unless You explicitly state otherwise, any Contribution intentionally submitted
125125+for inclusion in the Work by You to the Licensor shall be under the terms and
126126+conditions of this License, without any additional terms or conditions.
127127+Notwithstanding the above, nothing herein shall supersede or modify the terms of
128128+any separate license agreement you may have executed with Licensor regarding
129129+such Contributions.
130130+131131+## 6. Trademarks.
132132+133133+This License does not grant permission to use the trade names, trademarks,
134134+service marks, or product names of the Licensor, except as required for
135135+reasonable and customary use in describing the origin of the Work and
136136+reproducing the content of the NOTICE file.
137137+138138+## 7. Disclaimer of Warranty.
139139+140140+Unless required by applicable law or agreed to in writing, Licensor provides the
141141+Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
142142+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
143143+including, without limitation, any warranties or conditions of TITLE, NON-
144144+INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
145145+solely responsible for determining the appropriateness of using or
146146+redistributing the Work and assume any risks associated with Your exercise of
147147+permissions under this License.
148148+149149+## 8. Limitation of Liability.
150150+151151+In no event and under no legal theory, whether in tort (including negligence),
152152+contract, or otherwise, unless required by applicable law (such as deliberate
153153+and grossly negligent acts) or agreed to in writing, shall any Contributor be
154154+liable to You for damages, including any direct, indirect, special, incidental,
155155+or consequential damages of any character arising as a result of this License or
156156+out of the use or inability to use the Work (including but not limited to
157157+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
158158+any and all other commercial damages or losses), even if such Contributor has
159159+been advised of the possibility of such damages.
160160+161161+## 9. Accepting Warranty or Additional Liability.
162162+163163+While redistributing the Work or Derivative Works thereof, You may choose to
164164+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
165165+other liability obligations and/or rights consistent with this License. However,
166166+in accepting such obligations, You may act only on Your own behalf and on Your
167167+sole responsibility, not on behalf of any other Contributor, and only if You
168168+agree to indemnify, defend, and hold each Contributor harmless for any liability
169169+incurred by, or claims asserted against, such Contributor by reason of your
170170+accepting any such warranty or additional liability.
171171+172172+END OF TERMS AND CONDITIONS
173173+174174+Copyright 2023, Łukasz Niemier <lukasz@niemier.pl>.
175175+176176+Licensed under the Apache License, Version 2.0 (the "License");
177177+you may not use this file except in compliance with the License.
178178+You may obtain a copy of the License at
179179+180180+http://www.apache.org/licenses/LICENSE-2.0
181181+182182+Unless required by applicable law or agreed to in writing, software
183183+distributed under the License is distributed on an "AS IS" BASIS,
184184+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
185185+See the License for the specific language governing permissions and
186186+limitations under the License.
+44
README.md
···11+# e9p
22+33+Implementation of [9p2000][] file protocol in Erlang
44+55+## Goals
66+77+- [x] Message parsing
88+- [ ] Client implementation
99+ + [x] Establishing connection
1010+ + [ ] Tree walking
1111+ + [ ] IO server implementation for reading/writing files
1212+ + [ ] File/directory creation
1313+ + [ ] File/directory deletion
1414+ + [ ] File stats
1515+- [ ] Server implementation
1616+ + [x] Establishing connection
1717+ + [ ] Tree walking
1818+ + [ ] File/directory creation
1919+ + [ ] File/directory deletion
2020+ + [ ] File stats
2121+ + [ ] Customisable FS implementations
2222+2323+### Example FS
2424+2525+- [ ] "Passthrough" - which will simply allow accessing some "real" directory in
2626+ system FS
2727+- [ ] ErlProcFS - which will expose Erlang process tree and other internal data
2828+ via API similar to `procfs` from Linux
2929+3030+## Reasoning
3131+3232+I want to implement `procfs`-like API for Erlang to allow non-Erlang-fluent
3333+operators to navigate through Erlang processes. There is something similar
3434+implemented in [`fuserl`][fuserl], but that uses [`libfuse`][libfuse], which is
3535+[NIF][] implemented. That requires compilation of native code and can be
3636+problematic wrt cross compilation and stuff. On the other hand [9p2000][] is
3737+network protocol that can be implemented fully in Erlang, thus do not require
3838+any additional tools or compilation steps. It can also be accessed remotely if
3939+needed.
4040+4141+[9p2000]: http://ericvh.github.io/9p-rfc/rfc9p2000.html
4242+[fuserl]: https://github.com/tonyrog/fuserl
4343+[libfuse]: https://github.com/libfuse/libfuse
4444+[NIF]: https://www.erlang.org/doc/system/nif.html#