enclink.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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, /* attic */
  16. LINK_GHOSTCASE3
  17. };
  18. enum direction_t {
  19. FROM,
  20. TO
  21. };
  22. struct enc_link {
  23. const char *name;
  24. int type;
  25. void (*link) (int, direction_t);
  26. const char *(*write) (int, const char *, size_t *);
  27. int (*read) (int, char *, size_t *);
  28. void (*parse) (int, int, char *);
  29. };
  30. struct enc_link_dcc {
  31. struct enc_link *method;
  32. int method_number;
  33. };
  34. extern struct enc_link enclink[];
  35. extern int link_find_by_type(int);
  36. extern void link_link(int, int, int, direction_t);
  37. extern const char *link_write(int, const char *, size_t *);
  38. extern int link_read(int, char *, size_t *);
  39. extern void link_hash(int, char *);
  40. extern void link_send(int, const char *, ...) __attribute__((format(printf, 2, 3)));
  41. extern void link_done(int);
  42. extern void link_parse(int, char *);
  43. extern void link_get_method(int);
  44. extern void link_challenge_to(int idx, char *buf);
  45. #endif /* !_ENCLINK_H */