mac-address

xod/net/mac-address

Assembles a MAC address from 6 octets
mac-address
@/mac-address
Assembles a MAC address from 6 octets
IN1byte
1st octet
IN2byte
2nd octet
IN3byte
4th octet
IN4byte
3rd octet
IN5byte
6th octet
IN6byte
5th octet
mac-address
IN1
IN2
IN3
IN4
IN5
IN6
OUT
OUT@/mac-address
The MAC address

C++ implementation

node {
    meta {
        using Type = uint8_t*;
    }

    uint8_t mac[6];

    void evaluate(Context ctx) {
        mac[0] = getValue<input_IN1>(ctx);
        mac[1] = getValue<input_IN2>(ctx);
        mac[2] = getValue<input_IN3>(ctx);
        mac[3] = getValue<input_IN4>(ctx);
        mac[4] = getValue<input_IN5>(ctx);
        mac[5] = getValue<input_IN6>(ctx);

        emitValue<output_OUT>(ctx, mac);
    }
}