FILE MMAP LDA projet zmmap

hello

zig 0.12.0 dev night

I present to you ZMMAP, a utilization of MMAP with Zig.

First, let me talk about *LDA, a function available with IBM’s OS AS400. It’s a “Local Data Area” that allows for freely defining a structured type for communication with another entity, such as 2 programs or jobs.

Typically, in an enterprise, we define a structure covering a very wide common spectrum. So, to understand it well, we have a CRYPTO module, a CALLPGM module, an MMAP module, and a UDS structure (Unified Data Structure, referencing IBM).

MMAP:
A memory space with a record like a file, providing ultra-fast access. The commonly acknowledged issue is the confidential insecurity of the document. That’s why I’m using Zig’s cryptography, referencing aes_gcm.zig.

CALLPGM:
A module that allows calling another independent process using the function std.ChildProcess.spawnAndWait, enabling modular programming.

CRYPTO:
won’t discuss the cryptographic module. It’s a copy I took from the master of “Zig-lang” and adapted where only the data is taken into account. For more information, please visit the “Zig-lang” website.


https://github.com/AS400JPLPC/zig-mmap

The described process involves managing communications between different programs in an environment where multiple programs can be running simultaneously.
Here’s interpretation:

1. The first part indicates that there can be multiple communications between different programs (A, B, C, X) in a system.
2. To manage these communications, it's necessary to save the complete context of the initial request for each program.
3. Subsequently, the process resets the communication to handle a new request, ensuring that all variables and parameters are properly configured for the new process.
4. When a program returns to the initial point after a series of communications, it needs to restore and clean files to ensure system integrity.
5. The transaction is finalized by responding to the caller, reading previously saved data, and converting it into a usable format.

This process appears to be an organized way of managing interactions between different programs in a complex computing environment.

Cinematic:

I need to record an order. I go to the order program. I need to check the client (this program is independent); it will give me the client number. In the visualization program, I notice there is an accounting consultation tag. I navigate to a menu where I can check if the client is not in dispute, then I return and proceed to see how their orders are settled, etc. This is what the “ZMMAP” tool can allow.

the ZMMAP process is pure ZIG juice
of course my lib, includes 2 modules, but which are just there for me, the project does not depend on them, they are part of a more complex demonstration.
This shows the mechanisms of MMAP, why you should use crypto,
how should we do the inter-program call, etc…

I also talk about the very useful object LDA at IBM.

Have fun (at least I hope so)

Just a quick word for the community, a big thank you to those who answered my questions

as well as to the coders who left examples.

1 Like

Hey @JPL, always interesting stuff. I’d like to see more things that use cryptography as a design feature.

1 Like

hello,

I used cryptography, I agreed with what was said on the forums (for example, developpez.net or others) in general, about the vulnerability, not about the software, but the principle or the message being readable and thus modifiable. However, Zig’s cryptography not only makes it unreadable but also verifies integrity and has a control key somewhat like a checksum, and there, we get more than just cryptography, but a true security. I could have encrypted the keys but between the write and the read, it’s on the millisecond scale, the key files are destroyed. When I finished this small piece of code, I exposed my project to ChatGPT, not the code, but we talked for over an hour and I provided the principles in detail, his response was positive and constructive. I use ChatGPT as a mirror, somewhat like when you’re working on a project and you present it to the team, and sometimes during the presentation, we notice a gap… very handy when you’re alone at home :wink: :wink: . The Zig forum also helped me a lot, both with the questions I asked and with other people’s inquiries and their ways of approaching things.

1 Like

zig version 0.12.0-dev.3429+13a9d94a8