enclink.h 865 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* enclink.h
  2. *
  3. */
  4. #ifndef _ENCLINK_H
  5. #define _ENCLINK_H
  6. #include <sys/types.h>
  7. enum {
  8. LINK_GHOST = 0,
  9. LINK_GHOSTSHA1,
  10. LINK_GHOSTMD5,
  11. LINK_CLEARTEXT
  12. };
  13. enum direction_t {
  14. FROM,
  15. TO
  16. };
  17. struct enc_link {
  18. const char *name;
  19. int type;
  20. void (*link) (int, direction_t);
  21. char *(*write) (int, char *, size_t *);
  22. int (*read) (int, char *, size_t *);
  23. void (*parse) (int, int, char *);
  24. };
  25. extern struct enc_link enclink[];
  26. extern int link_find_by_type(int);
  27. extern void link_link(int, int, int, direction_t);
  28. extern char *link_write(int, char *, size_t *);
  29. extern int link_read(int, char *, size_t *);
  30. extern void link_hash(int, char *);
  31. extern void link_send(int, char *, ...) __attribute__((format(printf, 2, 3)));
  32. extern void link_done(int);
  33. extern void link_parse(int, char *);
  34. #endif /* !_ENCLINK_H */