iriap.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*********************************************************************
  2. *
  3. * Filename: iriap.h
  4. * Version: 0.5
  5. * Description: Information Access Protocol (IAP)
  6. * Status: Experimental.
  7. * Author: Dag Brattli <dagb@cs.uit.no>
  8. * Created at: Thu Aug 21 00:02:07 1997
  9. * Modified at: Sat Dec 25 16:42:09 1999
  10. * Modified by: Dag Brattli <dagb@cs.uit.no>
  11. *
  12. * Copyright (c) 1997-1999 Dag Brattli <dagb@cs.uit.no>,
  13. * All Rights Reserved.
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License as
  17. * published by the Free Software Foundation; either version 2 of
  18. * the License, or (at your option) any later version.
  19. *
  20. * Neither Dag Brattli nor University of Tromsø admit liability nor
  21. * provide warranty for any of this software. This material is
  22. * provided "AS-IS" and at no charge.
  23. *
  24. ********************************************************************/
  25. #ifndef IRIAP_H
  26. #define IRIAP_H
  27. #include <linux/types.h>
  28. #include <linux/skbuff.h>
  29. #include <net/irda/iriap_event.h>
  30. #include <net/irda/irias_object.h>
  31. #include <net/irda/irqueue.h> /* irda_queue_t */
  32. #include <net/irda/timer.h> /* struct timer_list */
  33. #define IAP_LST 0x80
  34. #define IAP_ACK 0x40
  35. #define IAS_SERVER 0
  36. #define IAS_CLIENT 1
  37. /* IrIAP Op-codes */
  38. #define GET_INFO_BASE 0x01
  39. #define GET_OBJECTS 0x02
  40. #define GET_VALUE 0x03
  41. #define GET_VALUE_BY_CLASS 0x04
  42. #define GET_OBJECT_INFO 0x05
  43. #define GET_ATTRIB_NAMES 0x06
  44. #define IAS_SUCCESS 0
  45. #define IAS_CLASS_UNKNOWN 1
  46. #define IAS_ATTRIB_UNKNOWN 2
  47. #define IAS_DISCONNECT 10
  48. typedef void (*CONFIRM_CALLBACK)(int result, __u16 obj_id,
  49. struct ias_value *value, void *priv);
  50. struct iriap_cb {
  51. irda_queue_t q; /* Must be first */
  52. magic_t magic; /* Magic cookie */
  53. int mode; /* Client or server */
  54. __u32 saddr;
  55. __u32 daddr;
  56. __u8 operation;
  57. struct sk_buff *request_skb;
  58. struct lsap_cb *lsap;
  59. __u8 slsap_sel;
  60. /* Client states */
  61. IRIAP_STATE client_state;
  62. IRIAP_STATE call_state;
  63. /* Server states */
  64. IRIAP_STATE server_state;
  65. IRIAP_STATE r_connect_state;
  66. CONFIRM_CALLBACK confirm;
  67. void *priv; /* Used to identify client */
  68. __u8 max_header_size;
  69. __u32 max_data_size;
  70. struct timer_list watchdog_timer;
  71. };
  72. int iriap_init(void);
  73. void iriap_cleanup(void);
  74. struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
  75. CONFIRM_CALLBACK callback);
  76. void iriap_close(struct iriap_cb *self);
  77. int iriap_getvaluebyclass_request(struct iriap_cb *self,
  78. __u32 saddr, __u32 daddr,
  79. char *name, char *attr);
  80. void iriap_connect_request(struct iriap_cb *self);
  81. void iriap_send_ack( struct iriap_cb *self);
  82. void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb);
  83. void iriap_register_server(void);
  84. #endif