~ubuntu-branches/ubuntu/jaunty/edbrowse/jaunty-security

« back to all changes in this revision

Viewing changes to tcp.h

  • Committer: Bazaar Package Importer
  • Author(s): Kapil Hari Paranjape
  • Date: 2008-04-09 18:55:23 UTC
  • mfrom: (1.1.4 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080409185523-dqokcloumyn1ibn4
Tags: 3.3.4-1
* New upstream version (3.3.4).
 - Convert between iso8859-1 and utf-8 on the fly.
 - Support reading of pdf using pdftohtml.
 - French translation of html documentation.
 - Old html documentation renamed to usersguide.
 - Additional documentation on philosophy.
* debian/control:
 - Changed homepage to sourcefource site.
 - Moved homepage from description to its own field.
 - Added "poppler-utils | xpdf-utils" to Recommends.
 - Added "www-browser", "mail-reader" and "editor" to Provides. 
 - Removed "XS-" from Vcs-Svn tag.
 - Standards-Version: 3.7.3
* debian/docs: Added new documentation files
  from "doc/" subdirectory.
* debian/watch: Updated to use sourceforge site.
* debian/edbrowse.doc-base:
  - Changed name of upstream provided html documentation from
    "ebdoc.html" to "usersguide.html".
  - Changed section from "net" to "Network/Web Browsing".
* debian/install: Compiled binary is now in "src/".

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* tcp.h: header file for NT/Unix TCP access layer */
2
 
 
3
 
#ifndef TCP_H
4
 
#define TCP_H 1
5
 
 
6
 
#ifdef _WIN32
7
 
#include <windows.h>
8
 
#else
9
 
#include <errno.h>
10
 
/* include this for htons() and its siblings */
11
 
#include <netinet/in.h>
12
 
#endif
13
 
 
14
 
typedef unsigned int IP32bit;
15
 
#define NULL_IP (IP32bit)(-1)
16
 
 
17
 
/* Name of the current machine, as in tuvok.intellivoice.com */
18
 
extern char tcp_thisMachineName[];
19
 
 
20
 
/* IP address of the current machine, packed and displayable. */
21
 
extern char tcp_thisMachineDots[];      /* "192.128.25.1" */
22
 
extern IP32bit tcp_thisMachineIP;       /* pack the above string */
23
 
extern char tcp_farMachineDots[];       /* like the above, but for the far machine */
24
 
extern IP32bit tcp_farMachineIP;
25
 
extern short tcp_farMachinePort;
26
 
 
27
 
/* Set up the TCP stack and initialize the above variables */
28
 
/* Returns 0 (ok) or -1 (with errno set) */
29
 
int tcp_init();
30
 
 
31
 
/* routines to convert between names and IP addresses */
32
 
int tcp_isDots(const char *s);
33
 
IP32bit tcp_name_ip(const char *name);
34
 
char *tcp_ip_name(IP32bit packed_ip);
35
 
char *tcp_name_dots(const char *name);
36
 
char *tcp_dots_name(const char *displayable_ip);
37
 
char *tcp_ip_dots(IP32bit packed_ip);
38
 
IP32bit tcp_dots_ip(const char *displayable_ip);
39
 
 
40
 
/* Connect to a far machine.  Use one of the above routines to
41
 
 * convert to the packed IP address of the far machine.
42
 
 * Returns the socket handle, or -1 if there was a problem. */
43
 
int tcp_connect(IP32bit far_ip, int far_portnum, int timeout);
44
 
 
45
 
/* Listen for an incoming connection.
46
 
 * We expect only one such connection at a time.
47
 
 * Returns the socket handle, or -1 if there was a problem. */
48
 
int tcp_listen(int portnum, int once);
49
 
void tcp_unlisten(void);
50
 
 
51
 
/* Read and write data on the socket.
52
 
 * returns the number of bytes read, or -1 if there was a problem. */
53
 
int tcp_read(int handle, char *buf, int buflen);
54
 
int tcp_readFully(int handle, char *buf, int buflen);
55
 
int tcp_write(int handle, const char *buf, int buflen);
56
 
 
57
 
/* Close the socket */
58
 
void tcp_close(int handle);
59
 
 
60
 
#endif