Skip to content

Adding support for AF_IUCV #667

Description

@clayton615

Hello all. As stated in the title I'm looking to add support for AF_IUCV sockets. Your contributing guide says to open an issue, so here I am.

AF_IUCV is an abstraction layer for IUCV (Inter User Communication Vehicle) on IBM Mainframes. It is predominantly used on z/VM and Linux on Z running under z/VM, though it can be used in other fashions such as with HyperSockets or z/OS.

The sockaddr struct looks like the following:

    pub struct sockaddr_iucv {
        pub siucv_family: crate::sa_family_t,
        __siucv_port: Padding<u16>, // unused crate::in_port_t
        __siucv_addr: Padding<u32>, // unused crate::in_addr_t
        pub siucv_nodeid: [c_char; 8], // technically unused on Linux, hopefully not forever
        pub siucv_user_id: [c_char; 8],
        pub siucv_name: [c_char; 8],

I got this added to libc in version 0.2.188 and would like to extend this to socket2 now.

Other than the connection method being to specify a "userid" and application "name", they work more or less like any other socket, going through the process of bind, listen, accept, or connect. The headers for them can be found on most 64-bit GNU Linux systems, which is nice since I do most of my development work on my laptop, but I think they're probably only usable on IBM Z.

I have already forked socket2 and added them to test that they worked, and I'm happy to report that they do, I can connect rust code on Linux on Z to my z/VM CMS IDs and communicate just fine, but that was a while ago so I'd need to rebase off the latest version, and there's a few things I'd like advice on.

  1. Should this become a variant of the SockAddr enum? SockAddrIucv?
  2. Because it can be useful to get the userid of the person connecting to you in a server situation, how would you recommend setting that up?
  3. How is the best way to restrict this to only 64-bit GNU Linux and Linux on the s390x platform?

Thank you for you consideration and let me know if I can explain anything better or in more detail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions