[Live-devel] Support for DSCP in Live555

Kjeld Mathias Petersen kjeld.petersen at dk.saabgroup.com
Thu Dec 15 23:28:59 PST 2022


Dear Sir

We have a request to your Live555 library,
that it shall be possible to set the DSCP value for Linux,
when a connection is opened.

We would like to suggest an additional method in GroupsockHelper, that sets the DSCP value
Boolean setSocketDSCP(int sock, u_int8_t dscp) {
#if defined(__WIN32__) || defined(_WIN32)
    // DSCP can't be set in Windows
#else
    if (dscp > 63) return False;
    const u_int8_t value = dscp << 2;
    if (setsockopt(sock, IPPROTO_IP, IP_TOS, (void*)&value, sizeof value) < 0)
        return False;
#endif
    return True;
}

And a call to this method from
int RTSPClient::openConnection() {
    ...
    fInputSocketNum = setupStreamSocket(envir(), 0);
    if (fInputSocketNum < 0) break;
    ignoreSigPipeOnSocket(fInputSocketNum); // so that servers on the same host that get killed don't also kill us
    if (fOutputSocketNum < 0) fOutputSocketNum = fInputSocketNum;
    setSocketDSCP(fInputSocketNum, _dscp);
    if (fOutputSocketNum != fInputSocketNum)
        setSocketDSCP(fOutputSocketNum, _dscp);

This require the RTSPClient to have a _dscp member that can be set by a method:
void RTSPClient::setDSCP(u_int8_t dscp)
{
    if (dscp > 63) return;
    _dscp = dscp;
}

The _dscp value should be initialized in the constructor to the default value 0.

Please
Could you consider our request

For you reference:
https://da.wikipedia.org/wiki/Differentiated_Services


Med venlig hilsen/ Best Regards

Kjeld Mathias Petersen
Software Developer
Communication Solutions
Business Area Surveillance

Tel.:  + 45 3638 3000
Mobile: + 45 4187 6042
E-mail: kjeld.petersen at dk.saabgroup.com<mailto:kjeld.petersen at dk.saabgroup.com>


[Saab_rgb_150px]


Saab Danmark A/S
Porten 6
DK - 6400 Sonderborg
www.saabgroup.com<http://www.saabgroup.com/>

This e-mail is private and confidential between the sender and the addressee.
In the event of misdirection, the recipient is prohibited from using, copying or
disseminating it or information in it. Please notify the above if any misdirection.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20221216/56381e47/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 1998 bytes
Desc: image001.jpg
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20221216/56381e47/attachment.jpg>


More information about the live-devel mailing list