-
Notifications
You must be signed in to change notification settings - Fork 1
/
tc_ipv6_eh_user.c
599 lines (505 loc) · 15.3 KB
/
tc_ipv6_eh_user.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
#include <bpf/bpf.h>
#include <bpf/bpf_endian.h>
#include <bpf/libbpf.h>
#include <errno.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/rpl.h>
#include <linux/seg6.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "tc_ipv6_eh.h"
#define MAP_DIR "/sys/fs/bpf/tc/globals/"
#define ARG_ENABLE "--enable"
#define ARG_DISABLE "--disable"
#define ARG_FORCE "--force"
#define ARG_HBH "--hbh"
#define ARG_DEST "--dest"
#define ARG_RH0 "--rh0"
#define ARG_RH2 "--rh2"
#define ARG_RH3 "--rh3"
#define ARG_RH4 "--rh4"
#define ARG_FRAG_A "--fragA"
#define ARG_FRAG_NA "--fragNA"
#define ARG_AH "--ah"
#define ARG_ESP "--esp"
#define MIN_BYTES_HBH 8
#define MIN_BYTES_DEST MIN_BYTES_HBH
#define MIN_BYTES_RH0 (sizeof(struct rt0_hdr) \
+ sizeof(((struct rt0_hdr*)0)->addr[0]))
#define MIN_BYTES_RH3 (sizeof(struct ipv6_rpl_sr_hdr) \
+ sizeof(((struct ipv6_rpl_sr_hdr*)0)->rpl_segaddr[0]))
#define MIN_BYTES_RH4 (sizeof(struct ipv6_sr_hdr) \
+ sizeof(((struct ipv6_sr_hdr*)0)->segments[0]))
#define MIN_BYTES_AH (sizeof(struct ip_auth_hdr) + 4)
#define MIN_BYTES_ESP (sizeof(struct ip_esp_hdr) + 8)
#define MAX_BYTES_HBH ((255 + 1) << 3)
#define MAX_BYTES_DEST MAX_BYTES_HBH
#define MAX_BYTES_RH0 (255 << 3)
#define MAX_BYTES_RH3 MAX_BYTES_RH0
#define MAX_BYTES_RH4 MAX_BYTES_RH0
#define MAX_BYTES_AH ((255 + 1) << 2)
#define MAX_BYTES_ESP ((MAX_BYTES) & (-8))
#define FLAGS_HBH (1 << 0)
#define FLAGS_DEST1 (1 << 1)
#define FLAGS_RH (1 << 2)
#define FLAGS_FRAG (1 << 3)
#define FLAGS_AH (1 << 4)
#define FLAGS_ESP (1 << 5)
#define FLAGS_DEST2 (1 << 6)
#define STR(x) STR2(x)
#define STR2(x) #x
#define MAP_NAME_STR ""STR(MAP_NAME)""
#define MAP_PATH MAP_DIR MAP_NAME_STR
#define MIN(a,b) ((a)<(b) ? (a):(b))
struct frag_hdr {
__u8 nexthdr;
__u8 reserved;
__be16 frag_off;
__be32 identification;
};
void print_help(const char *prog_name) {
printf("\nUsage: %s { --disable", prog_name);
printf(" | --enable [ --force ] EXTHDR [ EXTHDR ... EXTHDR ] }\n\n");
printf("EXTHDR := {");
printf(" %s %d..%d", ARG_HBH, MIN_BYTES_HBH, MAX_BYTES_HBH);
printf(" | %s %d..%d", ARG_DEST, MIN_BYTES_DEST, MAX_BYTES_DEST);
printf(" | %s %ld..%d", ARG_RH0, MIN_BYTES_RH0, MAX_BYTES_RH0);
printf(" | %s", ARG_RH2);
printf(" | %s %ld..%d", ARG_RH3, MIN_BYTES_RH3, MAX_BYTES_RH3);
printf(" | %s %ld..%d", ARG_RH4, MIN_BYTES_RH4, MAX_BYTES_RH4);
printf(" | %s | %s", ARG_FRAG_A, ARG_FRAG_NA);
printf(" | %s %ld..%d", ARG_AH, MIN_BYTES_AH, MAX_BYTES_AH);
printf(" | %s %ld..%d", ARG_ESP, MIN_BYTES_ESP, MAX_BYTES_ESP);
printf(" }\n\n");
printf("If a size is required, it MUST be an 8-octet multiple.\n");
printf("Routing Header sizes minus 8 MUST be 16-octet multiples.\n\n");
printf("Accepted chaining order, as per RFC8200 sec4.1:\n");
printf(" - Hop-by-Hop Options header\n");
printf(" - Destination Options header\n");
printf(" - Routing header\n");
printf(" - Fragment header\n");
printf(" - Authentication header\n");
printf(" - Encapsulating Security Payload header\n");
printf(" - Destination Options header\n");
}
void print_missing_size(const char *arg) {
printf("\nMissing size for \"%s\"\n", arg);
}
void print_invalid_size(const char *arg) {
printf("\nInvalid size for \"%s\"\n", arg);
}
void print_not_rfc8200_compliant() {
printf("\nNot RFC8200 compliant, use \"--force\" to override\n");
}
void print_size_overflow(__u32 max) {
printf("\nCannot exceed the total maximum size of %u bytes\n", max);
}
__u8 valid_size(const char *str, __u32 min, __u32 max, long *val) {
char *p;
*val = strtol(str, &p, 10);
if (!*val || strlen(p) > 0 || *val < min || *val > max || *val%8 != 0)
return 0;
return 1;
}
void random_ip6addr(struct in6_addr *addr) {
/* Used range: 2a00:0000::/12 (RIPE NCC) */
addr->s6_addr[0] = 0x2a;
addr->s6_addr[1] = 0x00;
for(unsigned int i = 2; i < sizeof(*addr); i++)
addr->s6_addr[i] = rand();
}
int main(int argc, char **argv) {
struct exthdr_t exthdr = {};
unsigned int i, j, key = 0;
__u8 flags = 0, force = 0;
int fd, ret;
void *ptr;
long n;
if (argc < 2 || (argc == 2 && strcmp(argv[1], ARG_DISABLE)) ||
(argc > 2 && strcmp(argv[1], ARG_ENABLE)) ||
(argc == 3 && !strcmp(argv[2], ARG_FORCE))) {
goto error_out;
}
if (!strcmp(argv[1], ARG_DISABLE))
goto update_map;
i = 2;
if (!strcmp(argv[2], ARG_FORCE)) {
i += 1;
force = 1;
}
srand(time(NULL));
for(i; i < argc; i++) {
ptr = &exthdr.bytes[exthdr.bytes_len];
if (!strcmp(argv[i], ARG_HBH)) {
if (i+1 == argc) {
print_missing_size(ARG_HBH);
goto error_out;
}
i += 1;
if (!valid_size(argv[i], MIN_BYTES_HBH, MAX_BYTES_HBH,
&n)) {
print_invalid_size(ARG_HBH);
goto error_out;
}
if (!force && (flags & (FLAGS_HBH | FLAGS_DEST1 |
FLAGS_RH | FLAGS_FRAG |
FLAGS_AH | FLAGS_ESP |
FLAGS_DEST2))) {
print_not_rfc8200_compliant();
goto error_out;
}
flags |= FLAGS_HBH;
if (exthdr.bytes_len + n > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct ipv6_opt_hdr *opt = ptr;
opt->hdrlen = (n >> 3) - 1;
for(j = sizeof(*opt); j+1 < n; j += 257) {
exthdr.bytes[exthdr.bytes_len+j] = 0x1e;
__u8 min_size = MIN(n-j-sizeof(*opt), 255);
exthdr.bytes[exthdr.bytes_len+j+1] = min_size;
__u32 pos = exthdr.bytes_len+j+2;
for(unsigned int k = 0; k < min_size; k++)
exthdr.bytes[pos+k] = rand();
}
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_HOPOPTS;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_HOPOPTS;
}
exthdr.off_last_nexthdr = exthdr.bytes_len
+ offsetof(struct ipv6_opt_hdr, nexthdr);
exthdr.bytes_len += n;
} else if (!strcmp(argv[i], ARG_DEST)) {
if (i+1 == argc) {
print_missing_size(ARG_DEST);
goto error_out;
}
i += 1;
if (!valid_size(argv[i], MIN_BYTES_DEST, MAX_BYTES_DEST,
&n)) {
print_invalid_size(ARG_DEST);
goto error_out;
}
if (!force && (flags & FLAGS_DEST2)) {
print_not_rfc8200_compliant();
goto error_out;
}
if (!(flags & (FLAGS_DEST1 | FLAGS_RH | FLAGS_FRAG |
FLAGS_AH | FLAGS_ESP)))
flags |= FLAGS_DEST1;
else
flags |= FLAGS_DEST2;
if (exthdr.bytes_len + n > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct ipv6_opt_hdr *opt = ptr;
opt->hdrlen = (n >> 3) - 1;
for(j = sizeof(*opt); j+1 < n; j += 257) {
exthdr.bytes[exthdr.bytes_len+j] = 0x1e;
__u8 min_size = MIN(n-j-sizeof(*opt), 255);
exthdr.bytes[exthdr.bytes_len+j+1] = min_size;
__u32 pos = exthdr.bytes_len+j+2;
for(unsigned int k = 0; k < min_size; k++)
exthdr.bytes[pos+k] = rand();
}
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_DSTOPTS;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_DSTOPTS;
}
exthdr.off_last_nexthdr = exthdr.bytes_len
+ offsetof(struct ipv6_opt_hdr, nexthdr);
exthdr.bytes_len += n;
} else if (!strcmp(argv[i], ARG_RH0)) {
if (i+1 == argc) {
print_missing_size(ARG_RH0);
goto error_out;
}
i += 1;
if (!valid_size(argv[i], MIN_BYTES_RH0, MAX_BYTES_RH0,
&n) || (n-8)%16 != 0) {
print_invalid_size(ARG_RH0);
goto error_out;
}
if (!force && (flags & (FLAGS_RH | FLAGS_FRAG |
FLAGS_AH | FLAGS_ESP |
FLAGS_DEST2))) {
print_not_rfc8200_compliant();
goto error_out;
}
flags |= FLAGS_RH;
if (exthdr.bytes_len + n > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct rt0_hdr *rh = ptr;
rh->rt_hdr.hdrlen = (n >> 3) - 1;
rh->rt_hdr.type = IPV6_SRCRT_TYPE_0;
__u16 rh_segs = (n - sizeof(*rh)) / sizeof(rh->addr[0]);
for(j = 0; j < rh_segs; j++) {
struct in6_addr rh_addr;
random_ip6addr(&rh_addr);
rh->addr[j] = rh_addr;
}
rh->rt_hdr.segments_left = rh_segs;
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_ROUTING;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_ROUTING;
}
exthdr.off_last_nexthdr = exthdr.bytes_len
+ offsetof(struct rt0_hdr, rt_hdr.nexthdr);
exthdr.bytes_len += n;
} else if (!strcmp(argv[i], ARG_RH2)) {
if (!force && (flags & (FLAGS_RH | FLAGS_FRAG |
FLAGS_AH | FLAGS_ESP |
FLAGS_DEST2))) {
print_not_rfc8200_compliant();
goto error_out;
}
flags |= FLAGS_RH;
if (exthdr.bytes_len + 24 > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct rt2_hdr *rh = ptr;
rh->rt_hdr.hdrlen = 2;
rh->rt_hdr.type = IPV6_SRCRT_TYPE_2;
rh->rt_hdr.segments_left = 1;
struct in6_addr rh_addr;
random_ip6addr(&rh_addr);
rh->addr = rh_addr;
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_ROUTING;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_ROUTING;
}
exthdr.off_last_nexthdr = exthdr.bytes_len
+ offsetof(struct rt2_hdr, rt_hdr.nexthdr);
exthdr.bytes_len += 24;
} else if (!strcmp(argv[i], ARG_RH3)) {
if (i+1 == argc) {
print_missing_size(ARG_RH3);
goto error_out;
}
i += 1;
if (!valid_size(argv[i], MIN_BYTES_RH3, MAX_BYTES_RH3,
&n) || (n-8)%16 != 0) {
print_invalid_size(ARG_RH3);
goto error_out;
}
if (!force && (flags & (FLAGS_RH | FLAGS_FRAG |
FLAGS_AH | FLAGS_ESP |
FLAGS_DEST2))) {
print_not_rfc8200_compliant();
goto error_out;
}
flags |= FLAGS_RH;
if (exthdr.bytes_len + n > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct ipv6_rpl_sr_hdr *rh = ptr;
rh->hdrlen = (n >> 3) - 1;
rh->type = IPV6_SRCRT_TYPE_3;
__u16 rh_segs = (n - sizeof(*rh)) / sizeof(rh->rpl_segaddr[0]);
for(j = 0; j < rh_segs; j++) {
struct in6_addr rh_addr;
random_ip6addr(&rh_addr);
rh->rpl_segaddr[j] = rh_addr;
}
rh->segments_left = rh_segs;
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_ROUTING;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_ROUTING;
}
exthdr.off_last_nexthdr = exthdr.bytes_len
+ offsetof(struct ipv6_rpl_sr_hdr, nexthdr);
exthdr.bytes_len += n;
} else if (!strcmp(argv[i], ARG_RH4)) {
if (i+1 == argc) {
print_missing_size(ARG_RH4);
goto error_out;
}
i += 1;
if (!valid_size(argv[i], MIN_BYTES_RH4, MAX_BYTES_RH4,
&n) || (n-8)%16 != 0) {
print_invalid_size(ARG_RH4);
goto error_out;
}
if (!force && (flags & (FLAGS_RH | FLAGS_FRAG |
FLAGS_AH | FLAGS_ESP |
FLAGS_DEST2))) {
print_not_rfc8200_compliant();
goto error_out;
}
flags |= FLAGS_RH;
if (exthdr.bytes_len + n > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct ipv6_sr_hdr *rh = ptr;
rh->hdrlen = (n >> 3) - 1;
rh->type = IPV6_SRCRT_TYPE_4;
__u16 rh_segs = (n - sizeof(*rh)) / sizeof(rh->segments[0]);
for(j = 0; j < rh_segs; j++) {
struct in6_addr rh_addr;
random_ip6addr(&rh_addr);
rh->segments[j] = rh_addr;
}
rh->segments_left = rh_segs;
rh->first_segment = rh_segs - 1;
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_ROUTING;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_ROUTING;
}
exthdr.off_last_nexthdr = exthdr.bytes_len
+ offsetof(struct ipv6_sr_hdr, nexthdr);
exthdr.bytes_len += n;
} else if (!strcmp(argv[i], ARG_FRAG_A)) {
if (!force && (flags & (FLAGS_FRAG | FLAGS_AH |
FLAGS_ESP | FLAGS_DEST2))) {
print_not_rfc8200_compliant();
goto error_out;
}
flags |= FLAGS_FRAG;
if (exthdr.bytes_len + 8 > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct frag_hdr *frag = ptr;
frag->identification = bpf_htonl(rand());
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_FRAGMENT;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_FRAGMENT;
}
exthdr.off_last_nexthdr = exthdr.bytes_len
+ offsetof(struct frag_hdr, nexthdr);
exthdr.bytes_len += 8;
} else if (!strcmp(argv[i], ARG_FRAG_NA)) {
if (!force && (flags & (FLAGS_FRAG | FLAGS_AH |
FLAGS_ESP | FLAGS_DEST2))) {
print_not_rfc8200_compliant();
goto error_out;
}
flags |= FLAGS_FRAG;
if (exthdr.bytes_len + 8 > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct frag_hdr *frag = ptr;
frag->identification = bpf_htonl(rand());
frag->frag_off = bpf_htons(1);
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_FRAGMENT;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_FRAGMENT;
}
exthdr.off_last_nexthdr = exthdr.bytes_len
+ offsetof(struct frag_hdr, nexthdr);
exthdr.bytes_len += 8;
} else if (!strcmp(argv[i], ARG_AH)) {
if (i+1 == argc) {
print_missing_size(ARG_AH);
goto error_out;
}
i += 1;
if (!valid_size(argv[i], MIN_BYTES_AH, MAX_BYTES_AH,
&n)) {
print_invalid_size(ARG_AH);
goto error_out;
}
if (!force && (flags & (FLAGS_AH | FLAGS_ESP |
FLAGS_DEST2))) {
print_not_rfc8200_compliant();
goto error_out;
}
flags |= FLAGS_AH;
if (exthdr.bytes_len + n > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct ip_auth_hdr *ah = ptr;
ah->spi = bpf_htonl(rand());
ah->seq_no = bpf_htonl(rand());
__u16 icv_len = n - 12;
ah->hdrlen = ((sizeof(*ah) + icv_len) >> 2) - 2;
for(j = 0; j < icv_len; j++)
ah->auth_data[j] = rand();
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_AH;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_AH;
}
exthdr.off_last_nexthdr = exthdr.bytes_len
+ offsetof(struct ip_auth_hdr, nexthdr);
exthdr.bytes_len += n;
} else if (!strcmp(argv[i], ARG_ESP)) {
if (i+1 == argc) {
print_missing_size(ARG_ESP);
goto error_out;
}
i += 1;
if (!valid_size(argv[i], MIN_BYTES_ESP, MAX_BYTES_ESP,
&n)) {
print_invalid_size(ARG_ESP);
goto error_out;
}
if (!force && (flags & (FLAGS_ESP | FLAGS_DEST2))) {
print_not_rfc8200_compliant();
goto error_out;
}
flags |= FLAGS_ESP;
if (exthdr.bytes_len + n > MAX_BYTES) {
print_size_overflow(MAX_BYTES);
goto error_out;
}
struct ip_esp_hdr *esp = ptr;
esp->spi = bpf_htonl(rand());
esp->seq_no = bpf_htonl(rand());
__u16 icv_len = n - 8;
for(j = 0; j < icv_len; j++)
esp->enc_data[j] = rand();
if (exthdr.bytes_len == 0) {
exthdr.ip6nexthdr = IPPROTO_ESP;
} else if (exthdr.off_last_nexthdr != MAX_BYTES) {
exthdr.bytes[exthdr.off_last_nexthdr] = IPPROTO_ESP;
}
exthdr.off_last_nexthdr = MAX_BYTES;
exthdr.bytes_len += n;
} else {
printf("\nUnexpected argument \"%s\"\n", argv[i]);
goto error_out;
}
}
update_map:
/* Retrieve the array map */
fd = bpf_obj_get(MAP_PATH);
if (fd < 0) {
fprintf(stderr, "Error opening map: %s\n", strerror(errno));
return 1;
}
/* Apply changes with lock */
ret = bpf_map_update_elem(fd, &key, &exthdr, BPF_EXIST|BPF_F_LOCK);
if (ret) {
fprintf(stderr, "Error updating map: %s\n", strerror(errno));
close(fd);
return 1;
}
close(fd);
return 0;
error_out:
print_help(argv[0]);
return 1;
}