bfa_defs_auth.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #ifndef __BFA_DEFS_AUTH_H__
  18. #define __BFA_DEFS_AUTH_H__
  19. #include <defs/bfa_defs_types.h>
  20. #define PUBLIC_KEY 15409
  21. #define PRIVATE_KEY 19009
  22. #define KEY_LEN 32399
  23. #define BFA_AUTH_SECRET_STRING_LEN 256
  24. #define BFA_AUTH_FAIL_TIMEOUT 0xFF
  25. /**
  26. * Authentication status
  27. */
  28. enum bfa_auth_status {
  29. BFA_AUTH_STATUS_NONE = 0, /* no authentication */
  30. BFA_AUTH_UNINIT = 1, /* state - uninit */
  31. BFA_AUTH_NEG_SEND = 2, /* state - negotiate send */
  32. BFA_AUTH_CHAL_WAIT = 3, /* state - challenge wait */
  33. BFA_AUTH_NEG_RETRY = 4, /* state - negotiate retry */
  34. BFA_AUTH_REPLY_SEND = 5, /* state - reply send */
  35. BFA_AUTH_STATUS_WAIT = 6, /* state - status wait */
  36. BFA_AUTH_SUCCESS = 7, /* state - success */
  37. BFA_AUTH_FAILED = 8, /* state - failed */
  38. BFA_AUTH_STATUS_UNKNOWN = 9, /* authentication status unknown */
  39. };
  40. struct auth_proto_stats_s {
  41. u32 auth_rjts;
  42. u32 auth_negs;
  43. u32 auth_dones;
  44. u32 dhchap_challenges;
  45. u32 dhchap_replies;
  46. u32 dhchap_successes;
  47. };
  48. /**
  49. * Authentication related statistics
  50. */
  51. struct bfa_auth_stats_s {
  52. u32 auth_failures; /* authentication failures */
  53. u32 auth_successes; /* authentication successes*/
  54. struct auth_proto_stats_s auth_rx_stats; /* Rx protocol stats */
  55. struct auth_proto_stats_s auth_tx_stats; /* Tx protocol stats */
  56. };
  57. /**
  58. * Authentication hash function algorithms
  59. */
  60. enum bfa_auth_algo {
  61. BFA_AUTH_ALGO_MD5 = 1, /* Message-Digest algorithm 5 */
  62. BFA_AUTH_ALGO_SHA1 = 2, /* Secure Hash Algorithm 1 */
  63. BFA_AUTH_ALGO_MS = 3, /* MD5, then SHA-1 */
  64. BFA_AUTH_ALGO_SM = 4, /* SHA-1, then MD5 */
  65. };
  66. /**
  67. * DH Groups
  68. *
  69. * Current value could be combination of one or more of the following values
  70. */
  71. enum bfa_auth_group {
  72. BFA_AUTH_GROUP_DHNULL = 0, /* DH NULL (value == 0) */
  73. BFA_AUTH_GROUP_DH768 = 1, /* DH group 768 (value == 1) */
  74. BFA_AUTH_GROUP_DH1024 = 2, /* DH group 1024 (value == 2) */
  75. BFA_AUTH_GROUP_DH1280 = 4, /* DH group 1280 (value == 3) */
  76. BFA_AUTH_GROUP_DH1536 = 8, /* DH group 1536 (value == 4) */
  77. BFA_AUTH_GROUP_ALL = 256 /* Use default DH group order
  78. * 0, 1, 2, 3, 4 */
  79. };
  80. /**
  81. * Authentication secret sources
  82. */
  83. enum bfa_auth_secretsource {
  84. BFA_AUTH_SECSRC_LOCAL = 1, /* locally configured */
  85. BFA_AUTH_SECSRC_RADIUS = 2, /* use radius server */
  86. BFA_AUTH_SECSRC_TACACS = 3, /* TACACS server */
  87. };
  88. /**
  89. * Authentication attributes
  90. */
  91. struct bfa_auth_attr_s {
  92. enum bfa_auth_status status;
  93. enum bfa_auth_algo algo;
  94. enum bfa_auth_group dh_grp;
  95. u16 rjt_code;
  96. u16 rjt_code_exp;
  97. u8 secret_set;
  98. u8 resv[7];
  99. };
  100. #endif /* __BFA_DEFS_AUTH_H__ */