?? intercom.h
字號:
/* intercom.h -- Prototypes and declarations for intercom.c Copyright (C) 2001-2003 Shane Wegner This file is part of Intercom. Intercom is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. Intercom 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 version 2 of the GNU General Public License along with Intercom; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA To contact the author, please send email to shane@cm.nu. *//* $Id: intercom.h,v 1.26 2003/02/13 20:22:49 shane Exp $ */#ifndef INTERCOM_H#define INTERCOM_H#include <time.h>#include <sys/types.h>#include <netinet/in.h>#include <netdb.h>#include "protocol.h"#include "iobuff.h"#include "gain.h"struct call_info {int state;int csock; /* controler (tcp) socket */int dsock; /* data socket (udp) */uint16_t rcv_dport;int loopback;int rdsp;int rdsp_blksize;char *rdsp_buff;int pdsp;int pdsp_blksize;char *pdsp_buff;uint32_t snd_sequence;uint32_t rcv_sequence;int snd_datasize; /* Size of a frame of audio data. Packets must be on this boundary */struct gain *ogain;struct gain *igain;#ifdef USE_CRYPTOstruct cryptinfo cryptinfo;#endifstruct {time_t start_time; /* Time when call was answered */uint32_t cpkts_sent; /* Control packets sent */uint32_t cpkts_recv; /* Control packets received */uint32_t cbytes_sent;uint32_t cbytes_recv;uint32_t apkts_sent; /* Audio packets sent */uint32_t apkts_recv; /* Audio packets received */uint32_t abytes_sent;uint32_t abytes_recv;uint32_t apkts_lost; /* Count of missing audio packets received */uint32_t apkts_order; /* Audio packets received out of sequence */} connstats;struct audio_params snd_aparams;struct audio_params rcv_aparams;struct sockaddr_in r_address;struct hostent *r_hostent;struct pkt_hello r_hellopkt;struct iobuff cssq;struct iobuff csrq;struct iobuff rdspq;struct iobuff pdspq;};/* Bit mannipulation macros. */#define BIT(n) (1<<n)#define SET_BIT(m, n) (m |= n)#define CLEAR_BIT(m, n) (m &= ~(n))#define TEST_BIT(m, n) ((m & n) ? 1 : 0)/* Flags for call states */#define CALL_STATE_IDLE 0#define CALL_STATE_CONNECTED BIT(0)#define CALL_STATE_CALLING BIT(1)#define CALL_STATE_WFRANSWER BIT(2) /* The other end of CALL_STATE_CALLING */#define CALL_STATE_AUDIORCV BIT(3)#define CALL_STATE_AUDIOSND BIT(4)#define CALL_STATE_HELLO BIT(5)#define CALL_STATE_INCALL BIT(6)extern int done;extern char *intercom_config_path;extern struct call_info call;struct compression_format {uint8_t fmt;char *name;char *description;};extern struct compression_format compression_table[];void refresh_userdefs(void);void icsetenv(const char *var, const char *value);int do_connect(const char *hostname, int port, struct sockaddr_in *r_address);int dsp_setup(const char *device, int mode, struct audio_params *params);void queuepacket(struct iobuff *iob, uint16_t type, char *pkt, size_t pktlen);void closecall(void);int setup_udpsock(struct sockaddr_in *addr);void send_errorpkt(struct iobuff *iob, uint16_t errorcode);int int_compression(const char *s);char *str_compression(int v);char *to_printable(char *s);#if (DEBUG >= 2)void hexdump(const char *buff, size_t n);#endif#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -