FreeCalypso > hg > themwi-rtp-lib
comparison src/set_dscp_prio.c @ 35:c0ce22777694
add helper functions for DSCP and socket priority
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Tue, 09 Jul 2024 01:56:26 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 34:fc77c3482084 | 35:c0ce22777694 |
|---|---|
| 1 /* | |
| 2 * Wrapper functions for setting DSCP and socket priority | |
| 3 * on both RTP and RTCP sockets. | |
| 4 */ | |
| 5 | |
| 6 #include <stdint.h> | |
| 7 | |
| 8 #include <osmocom/core/socket.h> | |
| 9 | |
| 10 #include <themwi/rtp/endp.h> | |
| 11 | |
| 12 int twrtp_endp_set_dscp(struct twrtp_endp *endp, uint8_t dscp) | |
| 13 { | |
| 14 int rc; | |
| 15 | |
| 16 rc = osmo_sock_set_dscp(endp->rtp_fd, dscp); | |
| 17 if (rc < 0) | |
| 18 return rc; | |
| 19 return osmo_sock_set_dscp(endp->rtcp_fd, dscp); | |
| 20 } | |
| 21 | |
| 22 int twrtp_endp_set_socket_prio(struct twrtp_endp *endp, int prio) | |
| 23 { | |
| 24 int rc; | |
| 25 | |
| 26 rc = osmo_sock_set_priority(endp->rtp_fd, prio); | |
| 27 if (rc < 0) | |
| 28 return rc; | |
| 29 return osmo_sock_set_priority(endp->rtcp_fd, prio); | |
| 30 } |
