A fast, lightweight and simple STOMP compatible messaging server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stomp.h 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2011 Bernhard Froehlich <decke@bluelife.at>
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Author's name may not be used endorse or promote products derived
  12. * from this software without specific prior written permission.
  13. *
  14. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  15. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  18. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  20. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  21. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  22. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  23. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  24. * POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. #ifndef _STOMP_H_
  27. #define _STOMP_H_
  28. #include <event2/buffer.h>
  29. #include <event2/http.h>
  30. #define MAXQUEUELEN 128
  31. #define MAXHEADERLEN 512
  32. #define MAXREQUESTLEN 10240
  33. enum stomp_direction {
  34. STOMP_IN = 1,
  35. STOMP_OUT
  36. };
  37. enum stomp_cmd {
  38. STOMP_CMD_NONE = 0,
  39. STOMP_CMD_CONNECT,
  40. STOMP_CMD_CONNECTED,
  41. STOMP_CMD_SEND,
  42. STOMP_CMD_MESSAGE,
  43. STOMP_CMD_SUBSCRIBE,
  44. STOMP_CMD_UNSUBSCRIBE,
  45. STOMP_CMD_ACK,
  46. STOMP_CMD_RECEIPT,
  47. STOMP_CMD_DISCONNECT,
  48. STOMP_CMD_ERROR
  49. };
  50. extern int stomp_connect(struct client *client);
  51. extern int stomp_disconnect(struct client *client);
  52. extern int stomp_subscribe(struct client *client);
  53. extern int stomp_send(struct client *client);
  54. extern int stomp_handle_request(struct client *client);
  55. extern int stomp_handle_response(struct client *client);
  56. #endif /* _STOMP_H_ */