It is interesting to know whether there is a way to conditionally mark
*each* outgoing IP packet with a *different* DSCP/TOS marking?

Basically: If I have a TCP socket which is used by 2 different
applications, each of which generates a particular kind of data; Is it
possible to mark some flag using socket API's (or otherwise), which
informs IP layer to perform DSCP marking based on the flag set?

I write a program to do the following:
==> Open socket.
==> If data is from application A, set flag abc.
Or if data is from application B, set flag xyz.
==> Send.

And, when it reaches IP, it:
==> Marks DSCP field of the packet with 11 if flag abc is set;
==> Marks DSCP field of the packet with 22 if flag xyz is set.

Thanks for any pointers or suggestions.