tcputil.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. /* Operations of the rpc manager */
  2. #include <netinet/in.h> /* For sockaddr_in needed by get_remote_port */
  3. /* Please note that the RPC manager does not use integers, it only uses */
  4. /* 4-byte integers for the comunication */
  5. enum {
  6. RPC_END, /* End of RPC commands */
  7. RPC_INT, /* Next argument is integer */
  8. RPC_STRING, /* Next argument is a string */
  9. RPC_BLOCK, /* Next argument is a len/block */
  10. RPC_LIMITED_STRING /* same as STRING, but has a limit on the size it accepts */
  11. };
  12. int rpc_get (int sock, ...);
  13. int rpc_send (int sock, ...);
  14. void rpc_add_get_callback (int sock, void (*cback)(int));
  15. int socket_read_block (int sock, char *dest, int len);
  16. int socket_write_block (int sock, char *buffer, int len);
  17. int send_string (int sock, char *string);
  18. void tcp_init (void);
  19. int get_remote_port (struct sockaddr_in *sin, int *version);
  20. int open_tcp_link (char *host, int *port, int *version, char *caller);
  21. char *get_host_and_username (char *path, char **host, char **user, int *port,
  22. int default_port, int default_to_anon, char **pass);
  23. extern int tcp_inited;
  24. extern int use_netrc;
  25. extern int got_sigpipe;