Skip to content

SockProtocol lacks protocols; No way to use ETH_P_ALL #854

@mexus

Description

@mexus

Currently the only protocols supported in SockProtocol are Tcp and Udp (for linux), while there are many more.

For example, I'm working with raw sockets and I need to specify a special ETH_P_ALL protocol (man 7 packet), and there is one important thing about it: its number has to be presented in network byte order when passed to the system socket call.

Currently the SockProtocol enum simply provides i32 constants, so I can't put htons conversion there since there is no const fn call for that.

There is also no way to provide an arbitrary integer as a protocol number to the nix's socket call, hence I'm left with no options.

So I would say it would be great to have an option to pass the protocol number as a number (i32 or whatever) to the socket call, but it might be there are other ways to address the issue.

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