Changeset 1027:0117a7746b21 in freeDiameter for extensions/app_diameap/diameap_user.c
- Timestamp:
- Apr 15, 2013, 4:17:07 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_diameap/diameap_user.c
r425 r1027 39 39 #include "libdiameap.h" 40 40 41 int diameap_user_get_userid(struct eap_user user, u8* userid)41 int diameap_user_get_userid(struct eap_user *user, u8* userid) 42 42 { 43 43 TRACE_ENTRY("%p %p",user,userid); 44 if (user .userid == NULL)44 if (user->userid == NULL) 45 45 return EINVAL; 46 userid = user .userid;46 userid = user->userid; 47 47 return 0; 48 48 } 49 49 50 int diameap_user_get_password(struct eap_user user, u8* password,u16 * passwordlength)50 int diameap_user_get_password(struct eap_user *user, u8* password,u16 * passwordlength) 51 51 { 52 52 TRACE_ENTRY("%p %p",user,password); 53 if (user .password == NULL)53 if (user->password == NULL) 54 54 return EINVAL; 55 password = user .password;56 *passwordlength = user .passwordLength;55 password = user->password; 56 *passwordlength = user->passwordLength; 57 57 return 0; 58 58 } 59 59 60 int diameap_user_get_passwordlength(struct eap_user user, u16 * passwordlength)60 int diameap_user_get_passwordlength(struct eap_user *user, u16 * passwordlength) 61 61 { 62 62 TRACE_ENTRY("%p %p",user,passwordlength); 63 if (user .password == NULL)63 if (user->password == NULL) 64 64 return EINVAL; 65 *passwordlength = user .passwordLength;65 *passwordlength = user->passwordLength; 66 66 return 0; 67 67 } … … 70 70 u16 passwordLength) 71 71 { 72 TRACE_ENTRY("%p %p % p",user,password,passwordLength);72 TRACE_ENTRY("%p %p %hu",user,password,passwordLength); 73 73 if (password == NULL) 74 74 return EINVAL; … … 83 83 u16 useridLength) 84 84 { 85 TRACE_ENTRY("%p %p % p",user,userid,useridLength);85 TRACE_ENTRY("%p %p %hu",user,userid,useridLength); 86 86 if (userid == NULL) 87 87 return EINVAL; … … 93 93 } 94 94 95 int diameap_user_get_methodid(struct eap_user user, int * methodid)95 int diameap_user_get_methodid(struct eap_user *user, int * methodid) 96 96 { 97 97 TRACE_ENTRY("%p %p",user,methodid); 98 if (user .password == NULL)98 if (user->password == NULL) 99 99 return EINVAL; 100 *methodid = user .methodId;100 *methodid = user->methodId; 101 101 return 0; 102 102 } … … 104 104 int diameap_user_set_methodid(struct eap_user * user, int methodId) 105 105 { 106 TRACE_ENTRY("%p % p",user,methodId);106 TRACE_ENTRY("%p %d",user,methodId); 107 107 if (user->password == NULL) 108 108 return EINVAL; … … 113 113 } 114 114 115 boolean diameap_user_issuccess(struct eap_user user)115 boolean diameap_user_issuccess(struct eap_user *user) 116 116 { 117 117 TRACE_ENTRY("%p",user); 118 if (user .password == NULL)118 if (user->password == NULL) 119 119 return FALSE; 120 return user .success;120 return user->success; 121 121 } 122 122 … … 130 130 } 131 131 132 int diameap_user_get_eap_method(struct eap_user user, int id,132 int diameap_user_get_eap_method(struct eap_user *user, int id, 133 133 struct eap_method *method) 134 134 { 135 TRACE_ENTRY("%p % p%p",user,id,method);136 if (sizeof(user .methods) >= (id - 1))137 *method = user .methods[id];135 TRACE_ENTRY("%p %d %p",user,id,method); 136 if (sizeof(user->methods) >= (id - 1)) 137 *method = user->methods[id]; 138 138 return 0; 139 139 } 140 140 141 141 int diameap_user_set_eap_method(struct eap_user * user, int id, 142 struct eap_method method)142 struct eap_method * method) 143 143 { 144 TRACE_ENTRY("%p % p%p",user,id,method);144 TRACE_ENTRY("%p %d %p",user,id,method); 145 145 if (user->password == NULL) 146 146 return EINVAL; 147 147 if (sizeof(user->methods) < (id - 1)) 148 148 return EINVAL; 149 user->methods[id].vendor = method .vendor;150 user->methods[id].method = method .method;149 user->methods[id].vendor = method->vendor; 150 user->methods[id].method = method->method; 151 151 return 0; 152 152 }
Note: See TracChangeset
for help on using the changeset viewer.