/* * Copyright (c) 2010-2019 Belledonne Communications SARL. * * This file is part of oRTP. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef ortp_events_h #define ortp_events_h #include "ortp/str_utils.h" #include "ortp/rtcp.h" #include "bctoolbox/list.h" typedef mblk_t OrtpEvent; typedef unsigned long OrtpEventType; typedef enum { OrtpRTPSocket, OrtpRTCPSocket } OrtpSocketType; struct _OrtpEventData{ mblk_t *packet; /* most events are associated to a received packet */ struct sockaddr_storage source_addr; socklen_t source_addrlen; ortpTimeSpec ts; union { int telephone_event; int payload_type; bool_t dtls_stream_encrypted; bool_t zrtp_stream_encrypted; bool_t ice_processing_successful; struct _ZrtpInfo{ char sas[32]; // up to 31 + null characters bool_t verified; bool_t cache_mismatch; bool_t pad[2]; } zrtp_info; OrtpSocketType socket_type; uint32_t received_rtt_character; bool_t congestion_detected; float video_bandwidth_available; int jitter_min_size_for_nack; } info; }; typedef struct _OrtpEventData OrtpEventData; #ifdef __cplusplus extern "C"{ #endif ORTP_PUBLIC OrtpEvent * ortp_event_new(OrtpEventType tp); ORTP_PUBLIC OrtpEventType ortp_event_get_type(const OrtpEvent *ev); /* type is one of the following*/ #define ORTP_EVENT_STUN_PACKET_RECEIVED 1 #define ORTP_EVENT_PAYLOAD_TYPE_CHANGED 2 #define ORTP_EVENT_TELEPHONE_EVENT 3 #define ORTP_EVENT_RTCP_PACKET_RECEIVED 4 /**