📄 netfone.h
字号:
// Modem configuration information
#define modemInputQueue 10240
#define modemOutputQueue 10240
extern int modemEnable; // Modem connections enabled ?
extern char modemInitString[128]; // Modem initialisation string
extern char baudrate[12]; // Baud rate
extern char commport[12]; // Communications port
extern int modemHandle; // Open modem comm port handle
extern int modemSessions; // Open sessions on modem
extern int modemShowRant; // Show rant about Windows serial I/O support
// Remembered connections
extern int rememberedConnections; // Number of remembered connections
extern LPSTR rememberedConnection[REMEMBER_CONNECTIONS]; // Remembered connections
// Multicast settings
extern int multiMemberships; // Number of multicast group memberships
#ifdef IP_MAX_MEMBERSHIPS
extern struct in_addr multiAddr[IP_MAX_MEMBERSHIPS]; // Multicast group IP numbers
extern LPSTR multiName[IP_MAX_MEMBERSHIPS]; // Multicast group names
#endif
extern int multiLoop; // Multicast loop-back mode
extern int multiBrainDead; // Multicast loop-back option not supported
// Answering machine
extern char answerFileName[MAX_PATH]; // Answering machine file name
extern char answerOutFileName[MAX_PATH]; // Answering machine outgoing message file name
extern int answerRecord; // Record incoming messages
// Show Your Face
extern char faceFileName[MAX_PATH]; // Face image file name
extern HFILE faceFile; // Face image file handle
extern int faceShow; // Show faces ?
// Look Who's Listening
extern char lwl_s_server[MAX_PATH]; // Look Who's Listening server name
extern char lwl_s_email[80]; // E-mail address
extern char lwl_s_fullname[80]; // Full name
extern char lwl_s_phone[80]; // Telephone number
extern char lwl_s_location[80]; // Location name
extern int lwl_s_publish; // Publish in directory ?
extern int lwl_s_exact; // Exact match only ?
extern char lwl_a_server[MAX_PATH]; // Look Who's Listening query server
extern int lwl_a_exact; // Exact matches only
extern int lwl_t_published; // Directory listing published
extern int lwl_t_resend; // Time to update directory listing ?
extern int lwl_t_pending; // LWL server update pending ?
extern struct sockaddr_in lookhost; // Look who's listening host, if any
// VAT/RTP communication state
extern unsigned long ssrc; // RTP synchronisation source identifier
extern unsigned long timestamp; // RTP packet timestamp
extern unsigned short seq; // RTP packet sequence number
extern unsigned long rtpdesrand; // RTP DES random RTCP prefix
extern char *sdes; // RTP SDES packet
extern int sdesl; // RTP SDES packet length
extern int spurt; // Start of talk spurt flag
extern char *vatid; // VAT ID packet
extern int vatidl; // VAT ID packet length
extern char *rtpsdes; // RTP SDES packet
extern int rtpsdesl; // RTP SDES packet length
extern HCURSOR phoneCursor, earCursor, boltCursor; // Cursor handles
// Anti-remote reincarnation protection
extern u_long Lazarus; // Lazarus host ID
extern int LazarusLong; // If nonzero, anti-reincarnation timeout
#define LazarusLength 15 // Lazarus timeout in seconds
extern char blankit[]; // Long string of blanks
#define V (void)
#ifdef RANT_ON_ERROR
#define errorRant(hwnd) {if (modemShowRant) { modemRant(hwnd); } }
#else
#define errorRant(hwnd)
#endif
// Function prototypes
extern void revlong(long *l);
extern void revshort(short *s);
// Connection window functions
extern LRESULT CALLBACK connectWndProc(HWND hwnd, UINT nMessage,
WPARAM wParam, LPARAM lParam);
extern HWND createNewConnection(LPCLIENT_DATA pClientData);
extern void connFetchFace(HWND hwndClient, LPCLIENT_DATA pClientData);
// Dialogue functions
extern VOID aboutDialogue(HWND hwndParent);
extern VOID propellerHeadDialogue(HWND hwndParent);
extern BOOL CALLBACK propellerHeadDlgProc(HWND hwnd,
UINT nMessage, WPARAM wParam, LPARAM lParam);
extern void propUpdateAudio(void);
extern VOID benchDialogue(HWND hwndParent);
extern BOOL newHostDialogue(HWND hwndParent, LPSTR pszHostName, LPIN_ADDR paddr,
unsigned short *port);
extern VOID genKeyDialogue(HWND hwnd);
extern VOID connectionProperties(HWND hwnd, LPCLIENT_DATA d);
extern VOID modemSetupDialogue(HWND hwnd);
extern void modemRant(HWND hwnd);
extern VOID multicastGroupsDialogue(HWND hwnd);
extern VOID answerDialogue(HWND hwndParent);
extern BOOL CALLBACK answerDlgProc(HWND hwnd, UINT nMessage,
WPARAM wParam, LPARAM lParam);
extern int faceDialogue(HWND hWndParent);
extern BOOL CALLBACK faceDlgProc(HWND hwnd, UINT nMessage,
WPARAM wParam, LPARAM lParam);
extern VOID lwl_ask(HWND hwnd);
extern VOID lwl_tell_settings(HWND hwnd);
extern BOOL voxMonitorDialog(HWND hwndParent);
extern BOOL IsVoxMonitorMessage(MSG *pmsg);
extern void voxMonitorUpdate(long nAudio, long nVox);
extern BOOL IsVoxMonitorOn();
// Frame window functions
extern LRESULT CALLBACK Frame_WndProc(HWND hwnd, UINT nMessage, WPARAM wParam, LPARAM lParam);
extern void ParseCommandLine(HWND hwnd, LPSTR pszCmdLine);
// Initialisation functions
extern BOOL InitApplication(HINSTANCE hInstance);
extern BOOL InitInstance(HINSTANCE hInstance, LPSTR pszCmdLine, INT nCmdShow);
void SetupICQ(void);
void SetICQData(HKEY hSpeakFreelyKey, char *szSpeakFreelyPath);
// Default Message Loop
extern void DefaultMessageLoop();
// WAVE file I/O functions
extern int readWaveInit(HWND hwndApp, LPCLIENT_DATA d, LPSTR szFileName);
extern int readWaveNext(HWND hwnd, LPCLIENT_DATA d);
extern void readWaveTerm(LPCLIENT_DATA d);
#ifdef MODEM
// CRC calculator functions
extern unsigned short crc(unsigned char *buff, int bufflen);
// Modem driver functions
extern int openModem(HWND hwnd);
extern int closeModem(HWND hwnd);
#endif
// Answering machine functions
extern int answerOpen(void);
extern void answerSave(struct in_addr IPaddr, LPSTR hostName, soundbuf *sb);
extern void answerSync(void);
extern void answerClose(void);
extern int answerEnabled(void);
// Local loopback functions
extern void loop_flush(LPCLIENT_DATA d);
extern int loop_sendto(LPCLIENT_DATA d, const char *buf, int len,
const struct sockaddr *to, int tolen);
extern int loop_recvfrom(LPCLIENT_DATA d, char *buf, int len,
struct sockaddr *from, int *fromlen);
extern int loop_samples(LPCLIENT_DATA d);
extern BOOL loop_control_port(LPCLIENT_DATA d);
// Show Your Face functions
extern void closeFaceFile(void);
extern int openFaceFile(HWND hwnd);
extern void processFaceRequest(soundbuf *d);
extern void processFaceData(HWND hwnd, LPCLIENT_DATA c, soundbuf *d);
// Look Who's Listening interface
extern int sendLwlMessage(HWND hDlg, int dobye);
extern int lwl_reconnect(HWND hDlg);
// RTP protocol functions
extern int rtp_make_sdes(char **pkt, unsigned long ssrc_i, int port, int exact, int strict);
extern int rtp_make_bye(unsigned char *p, unsigned long ssrc_i, char *raison, int strict);
extern int rtp_make_app(unsigned char *p, unsigned long ssrc_i,
int strict, char *type, char *content);
extern LONG rtpout(soundbuf *sb, unsigned long ssrc_i,
unsigned long timestamp_i, unsigned short seq_i,
int spurt);
extern int isValidRTCPpacket(unsigned char *p, int len);
extern int isRTCPByepacket(unsigned char *p, int len);
extern int isRTCPAPPpacket(unsigned char *p, int len, char *name, unsigned char **app_ptr);
extern int isrtp(unsigned char *pkt, int len);
extern int parseSDES(unsigned char *packet, struct rtcp_sdes_request *r);
extern void copySDESitem(char *s, char *d);
extern void string_DES_key(LPSTR key, LPBYTE des_key, char algorithm[16]);
// Text chat functions
#define RTCP_APP_TEXT_CHAT "SFtc" // APP packet name for text chat
#define WM_CHAT_TEXT_SEND (WM_USER + 1004) // Message sent to frame to transmit text chat
extern VOID chatDialogue(HWND hwndParent);
extern BOOL CALLBACK chatDlgProc(HWND hwnd, UINT nMessage, WPARAM wParam, LPARAM lParam);
extern void chatLog(HWND hwnd, char *ident, char *text);
// VAT protocol functions
extern int isvat(unsigned char *pkt, int len);
extern LONG vatout(soundbuf *sb, unsigned long ssrc_i, unsigned long timestamp_i, int spurt);
extern int makeVATid(char **vp, unsigned long ssrc_i);
extern int makevatdone(unsigned char *v, unsigned long ssrc_i);
// LPC10 compression functions
extern void lpc10init(void);
extern int lpc10encode(unsigned char *in, unsigned char *out, int inlen);
extern int lpc10decode(unsigned char *in, unsigned char *out, int inlen);
// Spectrum display functions
extern BOOL spectrumBarGraph; // Plot spectrum as bar chart, equaliser style ?
extern BOOL spectrumVoicePrint; // Plot spectrum as horizontal "waterfall" ?
extern BOOL spectrumTransmitOnly; // Show transmitted audio only ?
extern BOOL spectrumReceiveOnly; // Show received audio only ?
extern BOOL spectrumMaxEnergy; // Show maximum energy in packet, not RMS
extern double spectrum(short *samples, int nsamples, double *ps, int nfreqs, double maxpwr);
extern void spectrumEnd(void);
extern VOID spectralDialogue(HWND hwndParent);
extern BOOL CALLBACK spectralDlgProc(HWND hwnd, UINT nMessage, WPARAM wParam, LPARAM lParam);
extern void spectrumUpdate(LPSTR buffer, WORD buflen, DWORD channels,
DWORD rate, DWORD bytesec, WORD align, BOOL isInput);
// Utility functions
extern char *rstring(int resid);
extern char *rfilter(int resid);
extern INT MsgBox(HWND hwndParent, UINT fuType, LPSTR pszFormat, ...);
extern VOID WinPrintf(HDC hdc, INT row, INT col, LPSTR pszFormat, ...);
extern LPSTR SockerrToString(SOCKERR serr);
extern SOCKERR ResetSocket(SOCKET sock);
extern SOCKERR CreateSocket(SOCKET *psock, INT type, ULONG address, PORT port);
extern void playSound(HWND hWnd, LPCLIENT_DATA pClientData, soundbuf *d,
int bitsPerSample, int samplesPerSecond);
extern VOID newConnection(HWND hwnd, LPSTR connectionFile, LPSTR knownHost);
extern void adpcmdecomp( struct soundbuf *sb);
extern int startWaveInput(HWND hwnd);
extern int inputSampleCount(void);
extern void terminateWaveInput(void);
extern void compress2X(soundbuf *asb);
extern void createSoundBuffer(LPSTR buffer, WORD buflen, DWORD channels,
DWORD rate, DWORD bytesec, WORD align);
extern void shipSoundBuffer(HWND hwnd, LPCLIENT_DATA pClientData);
extern VOID startSoundFile(HWND hwnd, LPSTR pszFile);
extern LPBYTE GIFtoBMP(LPBYTE gif, int imageNumber);
extern void sessionKeyGenerate(LPSTR key, BOOL binary);
extern int makeInternalEncryptionKeys(HWND hwnd, LPCLIENT_DATA d);
extern void multicastJoin(HWND hwnd, int join);
extern void propeller(int control, DWORD value);
extern int obtainOutput(HWND hwnd);
extern unsigned char alaw2ulaw(unsigned char aval);
extern void rate_start(rate_t *rate, int inrate, int outrate);
extern void rate_flow(rate_t *rate, unsigned char *ibuf, unsigned char *obuf,
int *isamp, int *osamp);
#ifdef HEXDUMP
extern void xd(void *buf, int bufl, int dochar);
#endif
// Definitions for different builds of the program (e.g. domestic/exportable versions).
#define CONFERENCE_SUPPORT
#define BROADCAST_SUPPORT
// CRYPTO is now defined by the build configuration settings
//#define CRYPTO 1 // Include strong cryptographic security.
#define ECHO_SUPPORT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -