Skip to content

Commit

Permalink
Update srt-enums.h
Browse files Browse the repository at this point in the history
Updated enum definition to take new values into account aswell as reserved spaces.
  • Loading branch information
neoxpert authored and birme committed Sep 18, 2023
1 parent 23407ce commit b40d4a3
Showing 1 changed file with 70 additions and 63 deletions.
133 changes: 70 additions & 63 deletions src/srt-enums.h
Original file line number Diff line number Diff line change
@@ -1,66 +1,73 @@
#define ENUM(E) StaticValue(#E, Napi::Number::New(env, E))

// egrep '^\s+SRTO' srtcore/srt.h | sed 's/^.*\(SRTO_[^, ]*\)[, ].*$/ ENUM\(\1\), \\/'
#define ENUM(E,F) StaticValue(#E,Napi::Number::New(env,F))

#define SOCKET_OPTIONS \
ENUM(SRTO_MSS), \
ENUM(SRTO_SNDSYN), \
ENUM(SRTO_RCVSYN), \
ENUM(SRTO_ISN), \
ENUM(SRTO_FC), \
ENUM(SRTO_SNDBUF), \
ENUM(SRTO_RCVBUF), \
ENUM(SRTO_LINGER), \
ENUM(SRTO_UDP_SNDBUF), \
ENUM(SRTO_UDP_RCVBUF), \
ENUM(SRTO_RENDEZVOUS), \
ENUM(SRTO_SNDTIMEO), \
ENUM(SRTO_RCVTIMEO), \
ENUM(SRTO_REUSEADDR), \
ENUM(SRTO_MAXBW), \
ENUM(SRTO_STATE), \
ENUM(SRTO_EVENT), \
ENUM(SRTO_SNDDATA), \
ENUM(SRTO_RCVDATA), \
ENUM(SRTO_SENDER), \
ENUM(SRTO_TSBPDMODE), \
ENUM(SRTO_INPUTBW), \
ENUM(SRTO_OHEADBW), \
ENUM(SRTO_PASSPHRASE), \
ENUM(SRTO_PBKEYLEN), \
ENUM(SRTO_KMSTATE), \
ENUM(SRTO_IPTTL), \
ENUM(SRTO_IPTOS), \
ENUM(SRTO_TLPKTDROP), \
ENUM(SRTO_SNDDROPDELAY), \
ENUM(SRTO_NAKREPORT), \
ENUM(SRTO_VERSION), \
ENUM(SRTO_PEERVERSION), \
ENUM(SRTO_CONNTIMEO), \
ENUM(SRTO_SNDKMSTATE), \
ENUM(SRTO_RCVKMSTATE), \
ENUM(SRTO_LOSSMAXTTL), \
ENUM(SRTO_RCVLATENCY), \
ENUM(SRTO_PEERLATENCY), \
ENUM(SRTO_MINVERSION), \
ENUM(SRTO_STREAMID), \
ENUM(SRTO_CONGESTION), \
ENUM(SRTO_MESSAGEAPI), \
ENUM(SRTO_PAYLOADSIZE), \
ENUM(SRTO_TRANSTYPE), \
ENUM(SRTO_KMREFRESHRATE), \
ENUM(SRTO_KMPREANNOUNCE), \
ENUM(SRTO_ENFORCEDENCRYPTION), \
ENUM(SRTO_IPV6ONLY), \
ENUM(SRTO_PEERIDLETIMEO), \
ENUM(SRTO_PACKETFILTER)

ENUM(SRTO_MSS, 0), \
ENUM(SRTO_SNDSYN, 1), \
ENUM(SRTO_RCVSYN, 2), \
ENUM(SRTO_ISN, 3), \
ENUM(SRTO_FC, 4), \
ENUM(SRTO_SNDBUF, 5), \
ENUM(SRTO_RCVBUF, 6), \
ENUM(SRTO_LINGER, 7), \
ENUM(SRTO_UDP_SNDBUF, 8), \
ENUM(SRTO_UDP_RCVBUF, 9), \
ENUM(SRTO_RENDEZVOUS, 12), \
ENUM(SRTO_SNDTIMEO, 13), \
ENUM(SRTO_RCVTIMEO, 14), \
ENUM(SRTO_REUSEADDR, 15), \
ENUM(SRTO_MAXBW, 16), \
ENUM(SRTO_STATE, 17), \
ENUM(SRTO_EVENT, 18), \
ENUM(SRTO_SNDDATA, 19), \
ENUM(SRTO_RCVDATA, 20), \
ENUM(SRTO_SENDER, 21), \
ENUM(SRTO_TSBPDMODE, 22), \
ENUM(SRTO_LATENCY, 23), \
ENUM(SRTO_INPUTBW, 24), \
ENUM(SRTO_OHEADBW, 25), \
ENUM(SRTO_PASSPHRASE, 26), \
ENUM(SRTO_PBKEYLEN, 27), \
ENUM(SRTO_KMSTATE, 28), \
ENUM(SRTO_IPTTL, 29), \
ENUM(SRTO_IPTOS, 30), \
ENUM(SRTO_TLPKTDROP, 31), \
ENUM(SRTO_SNDDROPDELAY, 32), \
ENUM(SRTO_NAKREPORT, 33), \
ENUM(SRTO_VERSION, 34), \
ENUM(SRTO_PEERVERSION, 35), \
ENUM(SRTO_CONNTIMEO, 36), \
ENUM(SRTO_DRIFTTRACER, 37), \
ENUM(SRTO_MININPUTBW, 38), \
ENUM(SRTO_SNDKMSTATE, 40), \
ENUM(SRTO_RCVKMSTATE, 41), \
ENUM(SRTO_LOSSMAXTTL, 42), \
ENUM(SRTO_RCVLATENCY, 43), \
ENUM(SRTO_PEERLATENCY, 44), \
ENUM(SRTO_MINVERSION, 45), \
ENUM(SRTO_STREAMID, 46), \
ENUM(SRTO_CONGESTION, 47), \
ENUM(SRTO_MESSAGEAPI, 48), \
ENUM(SRTO_PAYLOADSIZE, 49), \
ENUM(SRTO_TRANSTYPE, 50), \
ENUM(SRTO_KMREFRESHRATE, 51), \
ENUM(SRTO_KMPREANNOUNCE, 52), \
ENUM(SRTO_ENFORCEDENCRYPTION, 53), \
ENUM(SRTO_IPV6ONLY, 54), \
ENUM(SRTO_PEERIDLETIMEO, 55), \
ENUM(SRTO_BINDTODEVICE, 56), \
ENUM(SRTO_GROUPCONNECT, 57), \
ENUM(SRTO_GROUPMINSTABLETIMEO, 58), \
ENUM(SRTO_GROUPTYPE, 59), \
ENUM(SRTO_PACKETFILTER, 60), \
ENUM(SRTO_RETRANSMITALGO, 61)

#define SOCKET_STATUS \
ENUM(SRTS_INIT), \
ENUM(SRTS_OPENED), \
ENUM(SRTS_LISTENING), \
ENUM(SRTS_CONNECTING), \
ENUM(SRTS_CONNECTED), \
ENUM(SRTS_BROKEN), \
ENUM(SRTS_CLOSING), \
ENUM(SRTS_CLOSED)
ENUM(SRTS_INIT, 1), \
ENUM(SRTS_OPENED, 2), \
ENUM(SRTS_LISTENING, 3), \
ENUM(SRTS_CONNECTING, 4), \
ENUM(SRTS_CONNECTED, 5), \
ENUM(SRTS_BROKEN, 6), \
ENUM(SRTS_CLOSING, 7), \
ENUM(SRTS_CLOSED, 8), \
ENUM(SRTS_NONEXIST, 9)

0 comments on commit b40d4a3

Please sign in to comment.