Simplify signature of get_encoding_rules(), make all rules static

This commit is contained in:
Martin Willi
2012-03-20 17:30:42 +01:00
parent 683d83ed3e
commit e9b55b8325
26 changed files with 114 additions and 137 deletions
@@ -74,7 +74,7 @@ struct private_auth_payload_t {
* The defined offsets are the positions in a object of type
* private_auth_payload_t.
*/
encoding_rule_t auth_payload_encodings[] = {
static encoding_rule_t encodings[] = {
/* 1 Byte next payload type, stored in the field next_payload */
{ U_INT_8, offsetof(private_auth_payload_t, next_payload) },
/* the critical bit */
@@ -119,11 +119,11 @@ METHOD(payload_t, verify, status_t,
return SUCCESS;
}
METHOD(payload_t, get_encoding_rules, void,
private_auth_payload_t *this, encoding_rule_t **rules, size_t *rule_count)
METHOD(payload_t, get_encoding_rules, int,
private_auth_payload_t *this, encoding_rule_t **rules)
{
*rules = auth_payload_encodings;
*rule_count = countof(auth_payload_encodings);
*rules = encodings;
return countof(encodings);
}
METHOD(payload_t, get_type, payload_type_t,