xref: /aosp_15_r20/external/e2fsprogs/lib/et/test_cases/simple.c (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Worker /*
2*6a54128fSAndroid Build Coastguard Worker  * simple.c:
3*6a54128fSAndroid Build Coastguard Worker  * This file is automatically generated; please do not edit it.
4*6a54128fSAndroid Build Coastguard Worker  */
5*6a54128fSAndroid Build Coastguard Worker 
6*6a54128fSAndroid Build Coastguard Worker #include <stdlib.h>
7*6a54128fSAndroid Build Coastguard Worker 
8*6a54128fSAndroid Build Coastguard Worker #define N_(a) a
9*6a54128fSAndroid Build Coastguard Worker 
10*6a54128fSAndroid Build Coastguard Worker static const char * const text[] = {
11*6a54128fSAndroid Build Coastguard Worker 	N_(			"Can't read ticket file"),
12*6a54128fSAndroid Build Coastguard Worker 	N_(			"Can't find ticket or TGT"),
13*6a54128fSAndroid Build Coastguard Worker 	N_(			"TGT expired"),
14*6a54128fSAndroid Build Coastguard Worker 	N_(			"Can't decode authenticator"),
15*6a54128fSAndroid Build Coastguard Worker 	N_(			"Ticket expired"),
16*6a54128fSAndroid Build Coastguard Worker 	N_(			"Repeated request"),
17*6a54128fSAndroid Build Coastguard Worker 	N_(			"The ticket isn't for us"),
18*6a54128fSAndroid Build Coastguard Worker 	N_(			"Request is inconsistent"),
19*6a54128fSAndroid Build Coastguard Worker 	N_(			"Delta-T too big"),
20*6a54128fSAndroid Build Coastguard Worker 	N_(			"Incorrect net address"),
21*6a54128fSAndroid Build Coastguard Worker 	N_(			"Protocol version mismatch"),
22*6a54128fSAndroid Build Coastguard Worker 	N_(			"Invalid message type"),
23*6a54128fSAndroid Build Coastguard Worker 	N_(			"Message stream modified"),
24*6a54128fSAndroid Build Coastguard Worker 	N_(			"Message out of order"),
25*6a54128fSAndroid Build Coastguard Worker 	N_(			"Unauthorized request"),
26*6a54128fSAndroid Build Coastguard Worker 	N_(			"Current password is null"),
27*6a54128fSAndroid Build Coastguard Worker 	N_(			"Incorrect current password"),
28*6a54128fSAndroid Build Coastguard Worker 	N_(			"Protocol error"),
29*6a54128fSAndroid Build Coastguard Worker 	N_(			"Error returned by KDC"),
30*6a54128fSAndroid Build Coastguard Worker 	N_(			"Null ticket returned by KDC"),
31*6a54128fSAndroid Build Coastguard Worker 	N_(			"Retry count exceeded"),
32*6a54128fSAndroid Build Coastguard Worker 	N_(			"Can't send request"),
33*6a54128fSAndroid Build Coastguard Worker     0
34*6a54128fSAndroid Build Coastguard Worker };
35*6a54128fSAndroid Build Coastguard Worker 
36*6a54128fSAndroid Build Coastguard Worker struct error_table {
37*6a54128fSAndroid Build Coastguard Worker     char const * const * msgs;
38*6a54128fSAndroid Build Coastguard Worker     long base;
39*6a54128fSAndroid Build Coastguard Worker     int n_msgs;
40*6a54128fSAndroid Build Coastguard Worker };
41*6a54128fSAndroid Build Coastguard Worker struct et_list {
42*6a54128fSAndroid Build Coastguard Worker     struct et_list *next;
43*6a54128fSAndroid Build Coastguard Worker     const struct error_table * table;
44*6a54128fSAndroid Build Coastguard Worker };
45*6a54128fSAndroid Build Coastguard Worker extern struct et_list *_et_list;
46*6a54128fSAndroid Build Coastguard Worker 
47*6a54128fSAndroid Build Coastguard Worker const struct error_table et_krb_error_table = { text, 39525376L, 22 };
48*6a54128fSAndroid Build Coastguard Worker 
49*6a54128fSAndroid Build Coastguard Worker static struct et_list link = { 0, 0 };
50*6a54128fSAndroid Build Coastguard Worker 
51*6a54128fSAndroid Build Coastguard Worker void initialize_krb_error_table_r(struct et_list **list);
52*6a54128fSAndroid Build Coastguard Worker void initialize_krb_error_table(void);
53*6a54128fSAndroid Build Coastguard Worker 
initialize_krb_error_table(void)54*6a54128fSAndroid Build Coastguard Worker void initialize_krb_error_table(void) {
55*6a54128fSAndroid Build Coastguard Worker     initialize_krb_error_table_r(&_et_list);
56*6a54128fSAndroid Build Coastguard Worker }
57*6a54128fSAndroid Build Coastguard Worker 
58*6a54128fSAndroid Build Coastguard Worker /* For Heimdal compatibility */
initialize_krb_error_table_r(struct et_list ** list)59*6a54128fSAndroid Build Coastguard Worker void initialize_krb_error_table_r(struct et_list **list)
60*6a54128fSAndroid Build Coastguard Worker {
61*6a54128fSAndroid Build Coastguard Worker     struct et_list *et, **end;
62*6a54128fSAndroid Build Coastguard Worker 
63*6a54128fSAndroid Build Coastguard Worker     for (end = list, et = *list; et; end = &et->next, et = et->next)
64*6a54128fSAndroid Build Coastguard Worker         if (et->table->msgs == text)
65*6a54128fSAndroid Build Coastguard Worker             return;
66*6a54128fSAndroid Build Coastguard Worker     et = malloc(sizeof(struct et_list));
67*6a54128fSAndroid Build Coastguard Worker     if (et == 0) {
68*6a54128fSAndroid Build Coastguard Worker         if (!link.table)
69*6a54128fSAndroid Build Coastguard Worker             et = &link;
70*6a54128fSAndroid Build Coastguard Worker         else
71*6a54128fSAndroid Build Coastguard Worker             return;
72*6a54128fSAndroid Build Coastguard Worker     }
73*6a54128fSAndroid Build Coastguard Worker     et->table = &et_krb_error_table;
74*6a54128fSAndroid Build Coastguard Worker     et->next = 0;
75*6a54128fSAndroid Build Coastguard Worker     *end = et;
76*6a54128fSAndroid Build Coastguard Worker }
77