enclink.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* enclink.h
  2. *
  3. */
  4. #ifndef _ENCLINK_H
  5. #define _ENCLINK_H
  6. #include <sys/types.h>
  7. /* must leave old ones in here */
  8. enum {
  9. LINK_GHOST = 0, /* attic */
  10. LINK_GHOSTNAT, /* attic */
  11. LINK_GHOSTSHA1, /* attic */
  12. LINK_GHOSTMD5, /* attic */
  13. LINK_CLEARTEXT,
  14. LINK_GHOSTCASE, /* attic */
  15. LINK_GHOSTCASE2
  16. };
  17. enum direction_t {
  18. FROM,
  19. TO
  20. };
  21. struct enc_link {
  22. const char *name;
  23. int type;
  24. void (*link) (int, direction_t);
  25. char *(*write) (int, char *, size_t *);
  26. int (*read) (int, char *, size_t *);
  27. void (*parse) (int, int, char *);
  28. };
  29. struct enc_link_dcc {
  30. struct enc_link *method;
  31. int method_number;
  32. };
  33. extern struct enc_link enclink[];
  34. extern int link_find_by_type(int);
  35. extern void link_link(int, int, int, direction_t);
  36. extern char *link_write(int, char *, size_t *);
  37. extern int link_read(int, char *, size_t *);
  38. extern void link_hash(int, char *);
  39. extern void link_send(int, const char *, ...) __attribute__((format(printf, 2, 3)));
  40. extern void link_done(int);
  41. extern void link_parse(int, char *);
  42. extern void link_get_method(int);
  43. #endif /* !_ENCLINK_H */