enclink.h 927 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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,
  11. LINK_GHOSTSHA1,
  12. LINK_GHOSTMD5,
  13. LINK_CLEARTEXT
  14. };
  15. enum direction_t {
  16. FROM,
  17. TO
  18. };
  19. struct enc_link {
  20. const char *name;
  21. int type;
  22. void (*link) (int, direction_t);
  23. char *(*write) (int, char *, size_t *);
  24. int (*read) (int, char *, size_t *);
  25. void (*parse) (int, int, char *);
  26. };
  27. extern struct enc_link enclink[];
  28. extern int link_find_by_type(int);
  29. extern void link_link(int, int, int, direction_t);
  30. extern char *link_write(int, char *, size_t *);
  31. extern int link_read(int, char *, size_t *);
  32. extern void link_hash(int, char *);
  33. extern void link_send(int, char *, ...) __attribute__((format(printf, 2, 3)));
  34. extern void link_done(int);
  35. extern void link_parse(int, char *);
  36. #endif /* !_ENCLINK_H */