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
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
|
# $OpenBSD: Makefile,v 1.6 2023/11/06 09:46:04 martijn Exp $
SNMP?= /usr/bin/snmp
SNMPD?= /usr/sbin/snmpd -f ${.OBJDIR}/snmpd.conf
SNMPGET?= ${SNMP} get
SNMPGETNEXT?= ${SNMP} getnext
SNMPBULKGET?= ${SNMP} bulkget
SNMPWALK?= ${SNMP} walk
SNMPBULKWALK?= ${SNMP} bulkwalk
SNMPSET?= ${SNMP} set
SNMPTRAP?= ${SNMP} trap
REGRESS_ROOT_TARGETS= start stop
REGRESS_SETUP_ONCE= start
REGRESS_TARGETS=
REGRESS_CLEANUP= stop
REGRESS_SKIP_TARGETS=
CLEANFILES=
IFIDX!= ifconfig egress | awk '/index/{print $$2}'
IFLLADDR!= ifconfig egress | awk '/lladdr/{gsub(":", " ", $$2); print toupper($$2)}'
CLEANFILES+= snmpd.conf
snmpd.conf: Makefile
printf 'listen_addr="127.0.0.1"\n' > snmpd.conf
printf 'listen6_addr="::1"\n\n' >> snmpd.conf
printf '# Restrict daemon to listen on localhost only\n' >> snmpd.conf
printf 'listen on $$listen_addr snmpv1 snmpv2c snmpv3\n' >> snmpd.conf
printf 'listen on tcp $$listen_addr snmpv1 snmpv2c snmpv3\n' >> snmpd.conf
printf 'listen on $$listen6_addr snmpv1 snmpv2c snmpv3\n' >> snmpd.conf
printf 'listen on tcp $$listen6_addr snmpv1 snmpv2c snmpv3\n' >> snmpd.conf
printf 'listen on $$listen_addr notify snmpv1 snmpv2c snmpv3\n\n' >> snmpd.conf
printf 'read-only community public\n' >> snmpd.conf
printf 'read-write community private\n' >> snmpd.conf
printf 'trap community public\n\n' >> snmpd.conf
printf '# (ab)use sysContact for DisplayString (255a) testing\n' >> snmpd.conf
printf 'system contact "Reyk Fl\303\266ter"\n' >> snmpd.conf
printf 'system services 74\n\n' >> snmpd.conf
printf '# Provide static user-defined SNMP OIDs\n' >> snmpd.conf
printf 'oid 1.3.6.1.4.1.30155.42.3.1 name testStringValue read-only string "Test"\n' >> snmpd.conf
printf 'oid 1.3.6.1.4.1.30155.42.3.2 name testStringValue read-only string "abcdefghijklmnopqrstuvwxyz"\n' >> snmpd.conf
printf 'oid 1.3.6.1.4.1.30155.42.3.3 name testIntValue read-write string a\n' >> snmpd.conf
printf 'oid 1.3.6.1.4.1.30155.42.3.4 name testIntValue read-write integer 1\n' >> snmpd.conf
printf '# (ab)use usmUserName for SnmpAdminString (255t) tests\n' >> snmpd.conf
printf 'oid 1.3.6.1.6.3.15.1.2.2.1.2.1 name testStringValue read-only string "Reyk Fl\303\266ter"\n' >> snmpd.conf
printf 'oid 1.3.6.1.6.3.15.1.2.2.1.2.2 name testStringValue read-only string "Reyk Fl\303ter"\n' >> snmpd.conf
printf "# 256 a's\n" >> snmpd.conf
printf 'oid 1.3.6.1.6.3.15.1.2.2.1.2.3 name testStringValue read-only string "%s"\n' "$$(jot -ba 256 | tr -d '\n')" >> snmpd.conf
printf "# 254 a's + replacement character\n" >> snmpd.conf
printf 'oid 1.3.6.1.6.3.15.1.2.2.1.2.4 name testStringValue read-only string "%s\357\277\275"\n\n' "$$(jot -ba 254 | tr -d '\n')" >> snmpd.conf
printf '# Enable SNMPv3 USM with authentication, encryption and two defined users\n' >> snmpd.conf
printf 'seclevel none\n\n' >> snmpd.conf
printf 'user md5_des authkey testtest auth hmac-md5 enckey testtest enc des\n' >> snmpd.conf
printf 'user md5_aes authkey testtest auth hmac-md5 enckey testtest enc aes\n' >> snmpd.conf
printf 'user sha1_des authkey testtest auth hmac-sha1 enckey testtest enc des\n' >> snmpd.conf
printf 'user sha1_aes authkey testtest auth hmac-sha1 enckey testtest enc aes\n' >> snmpd.conf
printf 'user sha224_des authkey testtest auth hmac-sha224 enckey testtest enc des\n' >> snmpd.conf
printf 'user sha224_aes authkey testtest auth hmac-sha224 enckey testtest enc aes\n' >> snmpd.conf
printf 'user sha256_des authkey testtest auth hmac-sha256 enckey testtest enc des\n' >> snmpd.conf
printf 'user sha256_aes authkey testtest auth hmac-sha256 enckey testtest enc aes\n' >> snmpd.conf
printf 'user sha384_des authkey testtest auth hmac-sha384 enckey testtest enc des\n' >> snmpd.conf
printf 'user sha384_aes authkey testtest auth hmac-sha384 enckey testtest enc aes\n' >> snmpd.conf
printf 'user sha512_des authkey testtest auth hmac-sha512 enckey testtest enc des\n' >> snmpd.conf
printf 'user sha512_aes authkey testtest auth hmac-sha512 enckey testtest enc aes\n\n' >> snmpd.conf
printf 'trap handle 1.3 "${.OBJDIR}/traphandle.sh"\n' >> snmpd.conf
CLEANFILES+= traphandle.sh
traphandle.sh: Makefile
printf '#!/bin/sh\n\n' > traphandle.sh
printf 'while read line; do\n' >> traphandle.sh
printf '\tprintf "%%s\\n" "$$line" >> ${.OBJDIR}/trap_output\n' >> traphandle.sh
printf 'done\n' >> traphandle.sh
chmod +x traphandle.sh
CLEANFILES+= trap_output
trap_output: Makefile
touch trap_output
chmod a+rw trap_output
start: stop snmpd.conf traphandle.sh trap_output
${SUDO} ${SNMPD}
stop:
-${SUDO} pkill -xf "${SNMPD}"
### AGENT FORMAT
REGRESS_TARGETS+= agent_udp_v4
CLEANFILES+= agent_udp_v4.res agent_udp_v4.exp
agent_udp_v4:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udp:127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_v4_port
CLEANFILES+= agent_udp_v4_port.res agent_udp_v4_port.exp
agent_udp_v4_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udp:127.0.0.1:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_v4_service
CLEANFILES+= agent_udp_v4_service.res agent_udp_v4_service.exp
agent_udp_v4_service:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udp:127.0.0.1:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_v4_port
CLEANFILES+= agent_v4_port.res agent_v4_port.exp
agent_v4_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic 127.0.0.1:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_v4_service
CLEANFILES+= agent_v4_service.res agent_v4_service.exp
agent_v4_service:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic 127.0.0.1:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_v4
CLEANFILES+= agent_tcp_v4.res agent_tcp_v4.exp
agent_tcp_v4:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcp:127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_v4_port
CLEANFILES+= agent_tcp_v4_port.res agent_tcp_v4_port.exp
agent_tcp_v4_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcp:127.0.0.1:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_udp6plain
CLEANFILES+= agent_udp_udp6plain.res agent_udp_udp6plain.exp
agent_udp_udp6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udp6:::1:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_udp6bracket
CLEANFILES+= agent_udp_udp6bracket.res agent_udp_udp6bracket.exp
agent_udp_udp6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udp6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_udp6bracket_port
CLEANFILES+= agent_udp_udp6bracket_port.res agent_udp_udp6bracket_port.exp
agent_udp_udp6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udp6:[::1]:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_UDP6plain
CLEANFILES+= agent_udp_UDP6plain.res agent_udp_UDP6plain.exp
agent_udp_UDP6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic UDP6:::1:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_UDP6bracket
CLEANFILES+= agent_udp_UDP6bracket.res agent_udp_UDP6bracket.exp
agent_udp_UDP6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic UDP6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_UDP6bracket_port
CLEANFILES+= agent_udp_UDP6bracket_port.res agent_udp_UDP6bracket_port.exp
agent_udp_UDP6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic UDP6:[::1]:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_udpv6plain
CLEANFILES+= agent_udp_udpv6plain.res agent_udp_udpv6plain.exp
agent_udp_udpv6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udpv6:::1:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_udpv6bracket
CLEANFILES+= agent_udp_udpv6bracket.res agent_udp_udpv6bracket.exp
agent_udp_udpv6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udpv6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_udpv6bracket_port
CLEANFILES+= agent_udp_udpv6bracket_port.res agent_udp_udpv6bracket_port.exp
agent_udp_udpv6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udpv6:[::1]:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_UDPv6plain
CLEANFILES+= agent_udp_UDPv6plain.res agent_udp_UDPv6plain.exp
agent_udp_UDPv6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic UDPv6:::1:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_UDPv6bracket
CLEANFILES+= agent_udp_UDPv6bracket.res agent_udp_UDPv6bracket.exp
agent_udp_UDPv6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic UDPv6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_UDPv6bracket_port
CLEANFILES+= agent_udp_UDPv6bracket_port.res agent_udp_UDPv6bracket_port.exp
agent_udp_UDPv6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic UDPv6:[::1]:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_udpipv6plain
CLEANFILES+= agent_udp_udpipv6plain.res agent_udp_udpipv6plain.exp
agent_udp_udpipv6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udpipv6:::1:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_udpipv6bracket
CLEANFILES+= agent_udp_udpipv6bracket.res agent_udp_udpipv6bracket.exp
agent_udp_udpipv6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udpipv6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_udpipv6bracket_port
CLEANFILES+= agent_udp_udpipv6bracket_port.res agent_udp_udpipv6bracket_port.exp
agent_udp_udpipv6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic udpipv6:[::1]:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_UDPIPv6plain
CLEANFILES+= agent_udp_UDPIPv6plain.res agent_udp_UDPIPv6plain.exp
agent_udp_UDPIPv6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic UDPIPv6:::1:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_UDPIPv6bracket
CLEANFILES+= agent_udp_UDPIPv6bracket.res agent_udp_UDPIPv6bracket.exp
agent_udp_UDPIPv6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic UDPIPv6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_udp_UDPIPv6bracket_port
CLEANFILES+= agent_udp_UDPIPv6bracket_port.res agent_udp_UDPIPv6bracket_port.exp
agent_udp_UDPIPv6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic UDPIPv6:[::1]:snmp sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_tcp6plain
CLEANFILES+= agent_tcp_tcp6plain.res agent_tcp_tcp6plain.exp
agent_tcp_tcp6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcp6:::1:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_tcp6bracket
CLEANFILES+= agent_tcp_tcp6bracket.res agent_tcp_tcp6bracket.exp
agent_tcp_tcp6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcp6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_tcp6bracket_port
CLEANFILES+= agent_tcp_tcp6bracket_port.res agent_tcp_tcp6bracket_port.exp
agent_tcp_tcp6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcp6:[::1]:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCP6plain
CLEANFILES+= agent_tcp_TCP6plain.res agent_tcp_TCP6plain.exp
agent_tcp_TCP6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic TCP6:::1:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCP6bracket
CLEANFILES+= agent_tcp_TCP6bracket.res agent_tcp_TCP6bracket.exp
agent_tcp_TCP6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic TCP6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCP6bracket_port
CLEANFILES+= agent_tcp_TCP6bracket_port.res agent_tcp_TCP6bracket_port.exp
agent_tcp_TCP6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic TCP6:[::1]:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_tcpv6plain
CLEANFILES+= agent_tcp_tcpv6plain.res agent_tcp_tcpv6plain.exp
agent_tcp_tcpv6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcpv6:::1:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_tcpv6bracket
CLEANFILES+= agent_tcp_tcpv6bracket.res agent_tcp_tcpv6bracket.exp
agent_tcp_tcpv6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcpv6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_tcpv6bracket_port
CLEANFILES+= agent_tcp_tcpv6bracket_port.res agent_tcp_tcpv6bracket_port.exp
agent_tcp_tcpv6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcpv6:[::1]:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCPv6plain
CLEANFILES+= agent_tcp_TCPv6plain.res agent_tcp_TCPv6plain.exp
agent_tcp_TCPv6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic TCPv6:::1:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCPv6bracket
CLEANFILES+= agent_tcp_TCPv6bracket.res agent_tcp_TCPv6bracket.exp
agent_tcp_TCPv6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic TCPv6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCPv6bracket_port
CLEANFILES+= agent_tcp_TCPv6bracket_port.res agent_tcp_TCPv6bracket_port.exp
agent_tcp_TCPv6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic TCPv6:[::1]:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCPv6bracket_port
CLEANFILES+= agent_tcp_TCPv6bracket_port.res agent_tcp_TCPv6bracket_port.exp
agent_tcp_tcpipv6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcpipv6:::1:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_tcpipv6bracket
CLEANFILES+= agent_tcp_tcpipv6bracket.res agent_tcp_tcpipv6bracket.exp
agent_tcp_tcpipv6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcpipv6:[::1] sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_tcpipv6bracket_port
CLEANFILES+= agent_tcp_tcpipv6bracket_port.res agent_tcp_tcpipv6bracket_port.exp
agent_tcp_tcpipv6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic tcpipv6:[::1]:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCPIPv6plain
CLEANFILES+= agent_tcp_TCPIPv6plain.res agent_tcp_TCPIPv6plain.exp
agent_tcp_TCPIPv6plain:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic TCPIPv6:::1:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCPIPv6bracket
CLEANFILES+= agent_tcp_TCPIPv6bracket.res agent_tcp_TCPIPv6bracket.exp
agent_tcp_TCPIPv6bracket:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic TCPIPv6:[::1] sysServices.0 > $@.res
diff -u $@.exp $@.res
REGRESS_TARGETS+= agent_tcp_TCPIPv6bracket_port
CLEANFILES+= agent_tcp_TCPIPv6bracket_port.res agent_tcp_TCPIPv6bracket_port.exp
agent_tcp_TCPIPv6bracket_port:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic TCPIPv6:[::1]:161 sysServices.0 > $@.res
diff -up $@.exp $@.res
### USM
REGRESS_TARGETS+= usm_noauthnopriv
CLEANFILES+= usm_noauthnopriv.res usm_noauthnopriv.exp
usm_noauthnopriv:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l noauthnopriv -u md5_des 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authnopriv_md5
CLEANFILES+= usm_authnopriv_md5.res usm_authnopriv_md5.exp
usm_authnopriv_md5:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authnopriv -u md5_des -a md5 -A testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authnopriv_sha1
CLEANFILES+= usm_authnopriv_sha1.res usm_authnopriv_sha1.exp
usm_authnopriv_sha1:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authnopriv -u sha1_des -a sha -A testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authnopriv_sha224
CLEANFILES+= usm_authnopriv_sha224.res usm_authnopriv_sha224.exp
usm_authnopriv_sha224:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authnopriv -u sha224_des -a sha-224 -A testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authnopriv_sha256
CLEANFILES+= usm_authnopriv_sha256.res usm_authnopriv_sha256.exp
usm_authnopriv_sha256:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authnopriv -u sha256_des -a sha-256 -A testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authnopriv_sha384
CLEANFILES+= usm_authnopriv_sha384.res usm_authnopriv_sha384.exp
usm_authnopriv_sha384:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authnopriv -u sha384_des -a sha-384 -A testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authnopriv_sha512
CLEANFILES+= usm_authnopriv_sha512.res usm_authnopriv_sha512.exp
usm_authnopriv_sha512:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authnopriv -u sha512_des -a sha-512 -A testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_md5_des
CLEANFILES+= usm_authpriv_md5_des.res usm_authpriv_md5_des.exp
usm_authpriv_md5_des:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u md5_des -a md5 -A testtest -x des -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_md5_aes
CLEANFILES+= usm_authpriv_md5_aes.res usm_authpriv_md5_aes.exp
usm_authpriv_md5_aes:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u md5_aes -a md5 -A testtest -x aes -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha1_des
CLEANFILES+= usm_authpriv_sha1_des.res usm_authpriv_sha1_des.exp
usm_authpriv_sha1_des:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha1_des -a sha -A testtest -x des -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha1_aes
CLEANFILES+= usm_authpriv_sha1_aes.res usm_authpriv_sha1_aes.exp
usm_authpriv_sha1_aes:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha1_aes -a sha -A testtest -x aes -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha224_des
CLEANFILES+= usm_authpriv_sha224_des.res usm_authpriv_sha224_des.exp
usm_authpriv_sha224_des:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha224_des -a sha-224 -A testtest -x des -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha224_aes
CLEANFILES+= usm_authpriv_sha224_aes.res usm_authpriv_sha224_aes.exp
usm_authpriv_sha224_aes:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha224_aes -a sha-224 -A testtest -x aes -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha256_des
CLEANFILES+= usm_authpriv_sha256_des.res usm_authpriv_sha256_des.exp
usm_authpriv_sha256_des:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha256_des -a sha-256 -A testtest -x des -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha256_aes
CLEANFILES+= usm_authpriv_sha256_aes.res usm_authpriv_sha256_aes.exp
usm_authpriv_sha256_aes:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha256_aes -a sha-256 -A testtest -x aes -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha384_des
CLEANFILES+= usm_authpriv_sha384_des.res usm_authpriv_sha384_des.exp
usm_authpriv_sha384_des:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha384_des -a sha-384 -A testtest -x des -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha384_aes
CLEANFILES+= usm_authpriv_sha384_aes.res usm_authpriv_sha384_aes.exp
usm_authpriv_sha384_aes:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha384_aes -a sha-384 -A testtest -x aes -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha512_des
CLEANFILES+= usm_authpriv_sha512_des.res usm_authpriv_sha512_des.exp
usm_authpriv_sha512_des:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha512_des -a sha-512 -A testtest -x des -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= usm_authpriv_sha512_aes
CLEANFILES+= usm_authpriv_sha512_aes.res usm_authpriv_sha512_aes.exp
usm_authpriv_sha512_aes:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v3 -l authpriv -u sha512_aes -a sha-512 -A testtest -x aes -X testtest 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
### OUTPUT FORMAT
REGRESS_TARGETS+= output_string
CLEANFILES+= output_string.exp output_string.res
output_string:
printf "sysDescr.0 = STRING: %s\n" "$$(uname -a)" > $@.exp
${SNMPGET} -v2c -cpublic 127.0.0.1 sysDescr.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_integer
CLEANFILES+= output_integer.res output_integer.exp
output_integer:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_oid
CLEANFILES+= output_oid.res output_oid.exp
output_oid:
# The OID name used here is not compatible with net-snmp, so this
# might change in the future.
printf "sysObjectID.0 = OID: localSystem.1\n" > $@.exp
${SNMPGET} -v2c -cpublic 127.0.0.1 sysObjectID.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_hexstring
CLEANFILES+= output_hexstring.res output_hexstring.exp
.if ${IFIDX} == ""
REGRESS_SKIP_TARGETS+= output_hexstring
.endif
output_hexstring:
# (Ab)use table for known unknown Hex-string. In this case: lladdr
printf "ifPhysAddress.%d = Hex-STRING: %s\n" "${IFIDX}" "${IFLLADDR}" > $@.exp
${SNMPGET} -v2c -cpublic 127.0.0.1 ifPhysAddress.${IFIDX} > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_ipstring
CLEANFILES+= output_ipstring.res output_ipstring.exp
output_ipstring:
printf "ipAdEntAddr.127.0.0.1 = IpAddress: 127.0.0.1\n" > $@.exp
${SNMPGET} -v2c -cpublic 127.0.0.1 ipAdEntAddr.127.0.0.1 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiettype_string
CLEANFILES+= output_quiettype_string.res output_quiettype_string.exp
output_quiettype_string:
printf "sysDescr.0 = %s\n" "$$(uname -a)" > $@.exp
${SNMPGET} -v2c -cpublic -OQ 127.0.0.1 sysDescr.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiettype_integer
CLEANFILES+= output_quiettype_integer.res output_quiettype_integer.exp
output_quiettype_integer:
printf "sysServices.0 = 74\n" > $@.exp
${SNMPGET} -v2c -cpublic -OQ 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiettype_oid
CLEANFILES+= output_quiettype_oid.res output_quiettype_oid.exp
output_quiettype_oid:
# The OID name used here is not compatible with net-snmp, so this
# might change in the future.
printf "sysObjectID.0 = localSystem.1\n" > $@.exp
${SNMPGET} -v2c -cpublic -OQ 127.0.0.1 sysObjectID.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiettype_ipstring
CLEANFILES+= output_quiettype_ipstring.res output_quiettype_ipstring.exp
output_quiettype_ipstring:
printf "ipAdEntAddr.127.0.0.1 = 127.0.0.1\n" > $@.exp
${SNMPGET} -v2c -cpublic -OQ 127.0.0.1 ipAdEntAddr.127.0.0.1 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiettype_hexstring
CLEANFILES+= output_quiettype_hexstring.res output_quiettype_hexstring.exp
.if ${IFIDX} == ""
REGRESS_SKIP_TARGETS+= output_quiettype_hexstring
.endif
output_quiettype_hexstring:
# (Ab)use table for known unknown Hex-string. In this case: lladdr
printf "ifPhysAddress.%d = %s\n" "${IFIDX}" "${IFLLADDR}" > $@.exp
${SNMPGET} -v2c -cpublic -OQ 127.0.0.1 ifPhysAddress.${IFIDX} > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_varbind_string
CLEANFILES+= output_varbind_string.res output_varbind_string.exp
output_varbind_string:
printf "STRING: %s\n" "$$(uname -a)" > $@.exp
${SNMPGET} -v2c -cpublic -Ov 127.0.0.1 sysDescr.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_varbind_integer
CLEANFILES+= output_varbind_integer.res output_varbind_integer.exp
output_varbind_integer:
printf "INTEGER: 74\n" > $@.exp
${SNMPGET} -v2c -cpublic -Ov 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_varbind_oid
CLEANFILES+= output_varbind_oid.res output_varbind_oid.exp
output_varbind_oid:
# The OID name used here is not compatible with net-snmp, so this
# might change in the future.
printf "OID: localSystem.1\n" > $@.exp
${SNMPGET} -v2c -cpublic -Ov 127.0.0.1 sysObjectID.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_varbind_ipstring
CLEANFILES+= output_varbind_ipstring.res output_varbind_ipstring.exp
output_varbind_ipstring:
printf "IpAddress: 127.0.0.1\n" > $@.exp
${SNMPGET} -v2c -cpublic -Ov 127.0.0.1 ipAdEntAddr.127.0.0.1 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_varbind_hexstring
CLEANFILES+= output_varbind_hexstring.res output_varbind_hexstring.exp
.if ${IFIDX} == ""
REGRESS_SKIP_TARGETS+= output_varbind_hexstring
.endif
output_varbind_hexstring:
# (Ab)use table for known unknown Hex-string. In this case: lladdr
printf "Hex-STRING: %s\n" "${IFLLADDR}" > $@.exp
${SNMPGET} -v2c -cpublic -Ov 127.0.0.1 ifPhysAddress.${IFIDX} > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiettype_varbind
CLEANFILES+= output_quiettype_varbind.res output_quiettype_varbind.exp
output_quiettype_varbind:
uname -a > $@.exp
${SNMPGET} -v2c -cpublic -OvQ 127.0.0.1 sysDescr.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_ascii
CLEANFILES+= output_ascii.res output_ascii.exp
.if ${IFIDX} == ""
REGRESS_SKIP_TARGETS+= output_ascii
.endif
output_ascii:
# Not a full test, since a mac-address can contain all kind of weirdness,
# so no guarantee that we handle everything. But I don't know a better
# alternative at this moment.
# Abuse $@.res for intermediate variable for easier cleanup.
printf 'ifPhysAddress.%d = STRING: "' "${IFIDX}" > $@.exp
printf "%s\n" "${IFLLADDR}" | tr ' ' '\n' | while read byte; do printf "\x$${byte}" | tr -c '[:print:]' '.'; done >> $@.exp
printf '"\n' >> $@.exp
${SNMPGET} -v2c -cpublic -Oa 127.0.0.1 ifPhysAddress.${IFIDX} > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_fulloid_mib
CLEANFILES+= output_fulloid_mib.res output_fulloid_mib.exp
output_fulloid_mib:
printf ".iso.org.dod.internet.mgmt.mib_2.system.sysDescr.0 = STRING: %s\n" "$$(uname -a)" > $@.exp
${SNMPGET} -v2c -cpublic -Of 127.0.0.1 sysDescr.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_fulloid_varbind
CLEANFILES+= output_fulloid_varbind.res output_fulloid_varbind.exp
output_fulloid_varbind:
printf ".iso.org.dod.internet.mgmt.mib_2.system.sysObjectID.0 = OID: .iso.org.dod.internet.private.enterprises.openBSD.localSystem.1\n" > $@.exp
${SNMPGET} -v2c -cpublic -Of 127.0.0.1 sysObjectID.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_numoid_mib
CLEANFILES+= output_numoid_mib.res output_numoid_mib.exp
output_numoid_mib:
printf ".1.3.6.1.2.1.1.1.0 = STRING: %s\n" "$$(uname -a)" > $@.exp
${SNMPGET} -v2c -cpublic -On 127.0.0.1 sysDescr.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_numoid_varbind
CLEANFILES+= output_numoid_varbind.res output_numoid_varbind.exp
output_numoid_varbind:
printf ".1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.30155.23.1\n" > $@.exp
${SNMPGET} -v2c -cpublic -On 127.0.0.1 sysObjectID.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiet_string
CLEANFILES+= output_quiet_string.res output_quiet_string.exp
output_quiet_string:
printf "sysDescr.0 %s\n" "$$(uname -a)" > $@.exp
${SNMPGET} -v2c -cpublic -Oq 127.0.0.1 sysDescr.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiet_integer
CLEANFILES+= output_quiet_integer.res output_quiet_integer.exp
output_quiet_integer:
printf "sysServices.0 74\n" > $@.exp
${SNMPGET} -v2c -cpublic -Oq 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiet_oid
CLEANFILES+= output_quiet_oid.res output_quiet_oid.exp
output_quiet_oid:
# The OID name used here is not compatible with net-snmp, so this
# might change in the future.
printf "sysObjectID.0 localSystem.1\n" > $@.exp
${SNMPGET} -v2c -cpublic -Oq 127.0.0.1 sysObjectID.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiet_ipstring
CLEANFILES+= output_quiet_ipstring.res output_quiet_ipstring.exp
output_quiet_ipstring:
printf "ipAdEntAddr.127.0.0.1 127.0.0.1\n" > $@.exp
${SNMPGET} -v2c -cpublic -Oq 127.0.0.1 ipAdEntAddr.127.0.0.1 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_quiet_hexstring
CLEANFILES+= output_quiet_hexstring.res output_quiet_hexstring.exp
.if ${IFIDX} == ""
REGRESS_SKIP_TARGETS+= output_quiet_hexstring
.endif
output_quiet_hexstring:
# (Ab)use table for known unknown Hex-string. In this case: lladdr
printf "ifPhysAddress.%d %s\n" "${IFIDX}" "${IFLLADDR}" > $@.exp
${SNMPGET} -v2c -cpublic -Oq 127.0.0.1 ifPhysAddress.${IFIDX} > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_hex
CLEANFILES+= output_hex.res output_hex.exp
output_hex:
# From testing net-snmp: hex mode wraps each 16 bytes.
# It happens that od does the same.
printf "localTest.3.2.0 = Hex-STRING: " > $@.exp
printf "abcdefghijklmnopqrstuvwxyz" | od -An -tx1 | sed 's/^ *//;s/ / /g;s/ *$$//' | tr '[:lower:]' '[:upper:]' >> $@.exp
${SNMPGET} -v2c -cpublic -Ox 127.0.0.1 1.3.6.1.4.1.30155.42.3.2.0 > $@.res
diff -up $@.exp $@.res
# XXX snmpd(8) setting customer oids under SNMPv2-MIB are not allowed anymore
REGRESS_TARGETS+= output_displayhint_255t_utf8
REGRESS_EXPECTED_FAILURES:= output_displayhint_255t_utf8
CLEANFILES+= output_displayhint_255t_utf8.res output_displayhint_255t_utf8.exp
output_displayhint_255t_utf8:
printf "STRING: Reyk Flöter\n" > $@.exp
LC_ALL=en_US.UTF-8 ${SNMPGET} -Ov -v2c -cpublic 127.0.0.1 1.3.6.1.6.3.15.1.2.2.1.2.1.0 > $@.res
diff -up $@.exp $@.res
# XXX snmpd(8) setting customer oids under SNMPv2-MIB are not allowed anymore
REGRESS_TARGETS+= output_displayhint_255t_ascii
REGRESS_EXPECTED_FAILURES+= output_displayhint_255t_ascii
CLEANFILES+= output_displayhint_255t_ascii.res output_displayhint_255t_ascii.exp
output_displayhint_255t_ascii:
printf "STRING: Reyk Fl.ter\n" > $@.exp
LC_ALL=C ${SNMPGET} -Ov -v2c -cpublic 127.0.0.1 1.3.6.1.6.3.15.1.2.2.1.2.1.0 > $@.res
diff -up $@.exp $@.res
# XXX snmpd(8) setting customer oids under SNMPv2-MIB are not allowed anymore
REGRESS_TARGETS+= output_displayhint_255t_invalchar_utf8
REGRESS_EXPECTED_FAILURES+= output_displayhint_255t_invalchar_utf8
CLEANFILES+= output_displayhint_255t_invalchar_utf8.res output_displayhint_255t_invalchar_utf8.exp
output_displayhint_255t_invalchar_utf8:
printf "STRING: Reyk Fl�ter\n" > $@.exp
LC_ALL=en_US.UTF-8 ${SNMPGET} -Ov -v2c -cpublic 127.0.0.1 1.3.6.1.6.3.15.1.2.2.1.2.2.0 > $@.res
diff -up $@.exp $@.res
# XXX snmpd(8) setting customer oids under SNMPv2-MIB are not allowed anymore
REGRESS_TARGETS+= output_displayhint_255t_invalchar_ascii
REGRESS_EXPECTED_FAILURES+= output_displayhint_255t_invalchar_ascii
CLEANFILES+= output_displayhint_255t_invalchar_ascii.res output_displayhint_255t_invalchar_ascii.exp
output_displayhint_255t_invalchar_ascii:
printf "STRING: Reyk Fl?ter\n" > $@.exp
LC_ALL=C ${SNMPGET} -Ov -v2c -cpublic 127.0.0.1 1.3.6.1.6.3.15.1.2.2.1.2.2.0 > $@.res
diff -up $@.exp $@.res
# XXX snmpd(8) setting customer oids under SNMPv2-MIB are not allowed anymore
REGRESS_TARGETS+= output_displayhint_255t_truncatefull
REGRESS_EXPECTED_FAILURES+= output_displayhint_255t_truncatefull
CLEANFILES+= output_displayhint_255t_truncatefull.res output_displayhint_255t_truncatefull.exp
output_displayhint_255t_truncatefull:
printf "STRING: %s\n" "$$(jot -ba 255 | tr -d '\n')" > $@.exp
LC_ALL=en_US.UTF-8 ${SNMPGET} -Ov -v2c -cpublic 127.0.0.1 1.3.6.1.6.3.15.1.2.2.1.2.3.0 > $@.res
diff -up $@.exp $@.res
# XXX snmpd(8) setting customer oids under SNMPv2-MIB are not allowed anymore
REGRESS_TARGETS+= output_displayhint_255t_truncatehalf
REGRESS_EXPECTED_FAILURES+= output_displayhint_255t_truncatehalf
CLEANFILES+= output_displayhint_255t_truncatehalf.res output_displayhint_255t_truncatehalf.exp
output_displayhint_255t_truncatehalf:
printf "STRING: %s\n" "$$(jot -ba 254 | tr -d '\n')" > $@.exp
LC_ALL=en_US.UTF-8 ${SNMPGET} -Ov -v2c -cpublic 127.0.0.1 1.3.6.1.6.3.15.1.2.2.1.2.4.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_displayhint_255a_utf8
CLEANFILES+= output_displayhint_255a_utf8.res output_displayhint_255a_utf8.exp
output_displayhint_255a_utf8:
printf "STRING: Reyk Fl��ter\n" > $@.exp
LC_ALL=en_US.UTF-8 ${SNMPGET} -Ov -v2c -cpublic 127.0.0.1 1.3.6.1.2.1.1.4.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_displayhint_255a_ascii
CLEANFILES+= output_displayhint_255a_ascii.res output_displayhint_255a_ascii.exp
output_displayhint_255a_ascii:
printf "STRING: Reyk Fl??ter\n" > $@.exp
LC_ALL=C-8 ${SNMPGET} -Ov -v2c -cpublic 127.0.0.1 1.3.6.1.2.1.1.4.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= output_displayhint_precedence
CLEANFILES+= output_displayhint_precedence.res output_displayhint_precedence.exp
output_displayhint_precedence:
printf "sysDescr.0 = STRING: %s\n" "$$(uname -a)" > $@.exp
${SNMPGET} -Ox -v2c -cpublic 127.0.0.1 sysDescr.0 > $@.res
diff -up $@.exp $@.res
### SNMP GET
# We already tested most of get in the previous tests.
# Just test the retrieval of multiple entries
REGRESS_TARGETS+= get_multiple
CLEANFILES+= get_multiple.res get_multiple.exp
get_multiple:
printf "sysServices.0 = INTEGER: 74\nsysDescr.0 = STRING: %s\n" "$$(uname -a)" > $@.exp
${SNMPGET} -v2c -cpublic 127.0.0.1 sysServices.0 sysDescr.0 > $@.res
diff -up $@.exp $@.res
### SNMP GETNEXT
REGRESS_TARGETS+= getnext_simple
CLEANFILES+= getnext_simple.res getnext_simple.exp
getnext_simple:
printf "sysDescr.0 = STRING: %s\n" "$$(uname -a)" > $@.exp
${SNMPGETNEXT} -v2c -cpublic 127.0.0.1 system > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= getnext_multiple
CLEANFILES+= getnext_multiple.res getnext_multiple.exp
getnext_multiple:
printf "sysServices.0 = INTEGER: 74\nsysDescr.0 = STRING: %s\n" "$$(uname -a)" > $@.exp
${SNMPGETNEXT} -v2c -cpublic 127.0.0.1 sysLocation.0 system > $@.res
diff -up $@.exp $@.res
### SNMP BULKGET
# Building output manually is large and error prone: Assume get/getnext works
# XXX snmpd(8) currently doesn't have any entries in sysORTable
REGRESS_TARGETS+= bulkget_simple
REGRESS_EXPECTED_FAILURES+= bulkget_simple
CLEANFILES+= bulkget_simple.res bulkget_simple.exp
bulkget_simple:
IDX=1; while [ $$IDX -le 4 ]; do ${SNMPGET} -v2c -cpublic 127.0.0.1 sysORDescr.$$IDX; IDX=$$((IDX+1)); done > $@.exp
${SNMPBULKGET} -v2c -cpublic -Cr4 127.0.0.1 sysORDescr > $@.res
diff -up $@.exp $@.res
# XXX snmpd(8) currently doesn't have any entries in sysORTable
REGRESS_TARGETS+= bulkget_multi
REGRESS_EXPECTED_FAILURES+= bulkget_multi
CLEANFILES+= bulkget_multi.res bulkget_multi.exp
bulkget_multi:
> $@.exp
IDX=1; while [ $$IDX -le 4 ]; do ${SNMPGET} -v2c -cpublic 127.0.0.1 sysORDescr.$$IDX sysORID.$$IDX; IDX=$$((IDX+1)); done >> $@.exp
${SNMPBULKGET} -v2c -cpublic -Cr4 127.0.0.1 sysORDescr sysORID > $@.res
diff -up $@.exp $@.res
# XXX snmpd(8) currently doesn't have any entries in sysORTable
REGRESS_TARGETS+= bulkget_nonrep
REGRESS_EXPECTED_FAILURES+= bulkget_nonrep
CLEANFILES+= bulkget_nonrep.res bulkget_nonrep.exp
bulkget_nonrep:
${SNMPGET} -v2c -cpublic 127.0.0.1 sysDescr.0 > $@.exp
IDX=1; while [ $$IDX -le 4 ]; do ${SNMPGET} -v2c -cpublic 127.0.0.1 sysORDescr.$$IDX; IDX=$$((IDX+1)); done >> $@.exp
${SNMPBULKGET} -v2c -cpublic -Cn1 -Cr4 127.0.0.1 sysDescr sysORDescr > $@.res
diff -up $@.exp $@.res
# XXX snmpd(8) currently doesn't have any entries in sysORTable
REGRESS_TARGETS+= bulkget_maxrep
REGRESS_EXPECTED_FAILURES+= bulkget_maxrep
CLEANFILES+= bulkget_maxrep.res bulkget_maxrep.exp
bulkget_maxrep:
IDX=1; while [ $$IDX -le 4 ]; do ${SNMPGET} -v2c -cpublic 127.0.0.1 sysORDescr.$$IDX; IDX=$$((IDX+1)); done > $@.exp
${SNMPBULKGET} -v2c -cpublic -Cr4 127.0.0.1 sysORDescr > $@.res
diff -up $@.exp $@.res
### SNMP WALK
# Building output manually is large and error prone: Assume getnext works
# Skip sysUptime, since it's a timer
REGRESS_TARGETS+= walk_simple
CLEANFILES+= walk_simple.res walk_simple.exp
walk_simple:
OID=system; while true; do OID="$$(${SNMPGETNEXT} -v2c -cpublic 127.0.0.1 "$$OID")"; [ -n "$${OID%sys*}" ] && break; printf "%s\n" "$${OID}"; OID="$${OID%% *}"; done | grep -v ^sysUpTime.0 > $@.exp
${SNMPWALK} -v2c -cpublic 127.0.0.1 system | grep -v ^sysUpTime.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= walk_end
CLEANFILES+= walk_end.res walk_end.exp
walk_end:
OID=system; while true; do OID="$$(${SNMPGETNEXT} -v2c -cpublic 127.0.0.1 "$$OID")"; [ "$${OID%% *}" == "sysServices.0" ] && break; printf "%s\n" "$${OID}"; OID="$${OID%% *}"; done | grep -v ^sysUpTime.0 > $@.exp
${SNMPWALK} -v2c -cpublic -CE sysServices 127.0.0.1 system | grep -v ^sysUpTime.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= walk_includeoid
CLEANFILES+= walk_includeoid.res walk_includeoid.exp
walk_includeoid:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPWALK} -v2c -cpublic 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= walk_excludeoid
CLEANFILES+= walk_excludeoid.res walk_excludeoid.exp
walk_excludeoid:
> $@.exp
${SNMPWALK} -v2c -cpublic -CI 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= walk_summary
CLEANFILES+= walk_summary.res walk_summary.exp
walk_summary:
OID=system; while true; do OID="$$(${SNMPGETNEXT} -v2c -cpublic 127.0.0.1 "$$OID")"; [ -n "$${OID%sys*}" ] && break; printf "%s\n" "$${OID}"; OID="$${OID%% *}"; done | grep -v ^sysUpTime.0 > $@.exp
wc -l $@.exp | awk '{printf("Variables found: %d\n", $$1 + 1)}' >> $@.exp
${SNMPWALK} -v2c -cpublic -Cp 127.0.0.1 system | grep -v ^sysUpTime.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= walk_skip
CLEANFILES+= walk_skip.exp walk_skip.res
walk_skip:
OID=system; while true; do OID="$$(${SNMPGETNEXT} -v2c -cpublic 127.0.0.1 "$$OID")"; [ -n "$${OID%sys*}" ] && break; printf "%s\n" "$${OID}"; OID="$${OID%% *}"; done | grep -v ^sysUpTime.0 > $@.exp
${SNMPWALK} -v2c -cpublic -Cs sysUpTime 127.0.0.1 system > $@.res
diff -up $@.exp $@.res
### SNMP BULKWALK
REGRESS_TARGETS+= bulkwalk_simple
CLEANFILES+= bulkwalk_simple.res bulkwalk_simple.exp
bulkwalk_simple:
OID=system; while true; do OID="$$(${SNMPGETNEXT} -v2c -cpublic 127.0.0.1 "$$OID")"; [ -n "$${OID%sys*}" ] && break; printf "%s\n" "$${OID}"; OID="$${OID%% *}"; done | grep -v ^sysUpTime.0 > $@.exp
${SNMPBULKWALK} -v2c -cpublic 127.0.0.1 system | grep -v ^sysUpTime.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= bulkwalk_includeoid
CLEANFILES+= bulkwalk_includeoid.res bulkwalk_includeoid.exp
bulkwalk_includeoid:
printf "sysServices.0 = INTEGER: 74\n" > $@.exp
${SNMPBULKWALK} -v2c -cpublic 127.0.0.1 sysServices.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= bulkwalk_summary
CLEANFILES+= bulkwalk_summary.res bulkwalk_summary.exp
bulkwalk_summary:
OID=system; while true; do OID="$$(${SNMPGETNEXT} -v2c -cpublic 127.0.0.1 "$$OID")"; [ -n "$${OID%sys*}" ] && break; printf "%s\n" "$${OID}"; OID="$${OID%% *}"; done | grep -v ^sysUpTime.0 > $@.exp
wc -l $@.exp | awk '{printf("Variables found: %d\n", $$1 + 1)}' >> $@.exp
${SNMPBULKWALK} -v2c -cpublic -Cp 127.0.0.1 system | grep -v ^sysUpTime.0 > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= bulkwalk_skip
CLEANFILES+= bulkwalk_skip.exp bulkwalk_skip.res
bulkwalk_skip:
OID=system; while true; do OID="$$(${SNMPGETNEXT} -v2c -cpublic 127.0.0.1 "$$OID")"; [ -n "$${OID%sys*}" ] && break; printf "%s\n" "$${OID}"; OID="$${OID%% *}"; done | grep -v ^sysUpTime.0 > $@.exp
${SNMPBULKWALK} -v2c -cpublic -Cs sysUpTime 127.0.0.1 system > $@.res
diff -up $@.exp $@.res
### SNMP SET
# XXX snmpd(8) doesn't support set
REGRESS_TARGETS+= set_string
REGRESS_EXPECTED_FAILURES+= set_string
CLEANFILES+= set_string.res set_string.exp
set_string:
${SNMPGET} -v2c -cpublic -Oqv 127.0.0.1 1.3.6.1.4.1.30155.42.3.3.0 | awk '{ printf("%sa\n", $$1) }' > $@.exp
${SNMPSET} -v2c -cprivate -Oqv 127.0.0.1 1.3.6.1.4.1.30155.42.3.3.0 s $$(cat $@.exp) > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= set_integer
REGRESS_EXPECTED_FAILURES+= set_integer
CLEANFILES+= set_integer.res set_integer.exp
set_integer:
${SNMPGET} -v2c -cpublic -Oqv 127.0.0.1 1.3.6.1.4.1.30155.42.3.4.0 | awk '{ print $$1 + 1 }' > $@.exp
${SNMPSET} -v2c -cprivate -Oqv 127.0.0.1 1.3.6.1.4.1.30155.42.3.4.0 i $$(cat $@.exp) > $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= set_string_integer
REGRESS_EXPECTED_FAILURES+= set_string_integer
CLEANFILES+= set_string_integer.res set_string_integer.exp
set_string_integer:
${SNMPGET} -v2c -cpublic -Oqv 127.0.0.1 1.3.6.1.4.1.30155.42.3.3.0 1.3.6.1.4.1.30155.42.3.4.0 | \
awk 'NR == 1 { printf("%sa\n", $$1) } NR == 2 { print $$1 + 1 }' > $@.exp
${SNMPSET} -v2c -cprivate -Oqv 127.0.0.1 1.3.6.1.4.1.30155.42.3.3.0 s $$(head -1 $@.exp) 1.3.6.1.4.1.30155.42.3.4.0 i $$(tail -1 $@.exp) > $@.res
diff -up $@.exp $@.res
### SNMP TRAP
TRAP_EXEC!= ${SUDO} su -s /bin/sh _snmpd -c '[ -r ${.OBJDIR}/traphandle.sh ]' > /dev/null 2>&1 && printf 'yes' || printf 'no'
REGRESS_TARGETS+= trap_simple
CLEANFILES+= trap_simple.res trap_simple.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_simple
.endif
trap_simple:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_ip
CLEANFILES+= trap_ip.res trap_ip.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_ip
.endif
trap_ip:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 192.168.1.1\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 a 192.168.1.1
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_bitstring
CLEANFILES+= trap_bitstring.res trap_bitstring.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_bitstring
.endif
trap_bitstring:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 "a"\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 b '1,2,7'
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_counter32
CLEANFILES+= trap_counter32.res trap_counter32.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_counter32
.endif
trap_counter32:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 20\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 c 20
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_decimal
CLEANFILES+= trap_decimal.res trap_decimal.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_decimal
.endif
trap_decimal:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 "hello world"\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 d '104 101 108 108 111 32 119 111 114 108 100'
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_integer
CLEANFILES+= trap_integer.res trap_integer.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_integer
.endif
trap_integer:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 42\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 i 42
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_null
CLEANFILES+= trap_null.res trap_null.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_null
.endif
trap_null:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 n ignored
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_oid
CLEANFILES+= trap_oid.res trap_oid.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_oid
.endif
trap_oid:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 iso.org.dod\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 o 1.3.6
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_string
CLEANFILES+= trap_string.res trap_string.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_string
.endif
trap_string:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 "hello world"\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 s "hello world"
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_timeticks
CLEANFILES+= trap_timeticks.res trap_timeticks.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_timeticks
.endif
trap_timeticks:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 420\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 t 420
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_unsigned
CLEANFILES+= trap_unsigned.res trap_unsigned.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_unsigned
.endif
trap_unsigned:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 420\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 u 420
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_hex
CLEANFILES+= trap_hex.res trap_hex.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_hex
.endif
trap_hex:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 "hello world"\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 x '68 65 6c 6c 6f 20 77 6f 72 6c 64'
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
REGRESS_TARGETS+= trap_multi
CLEANFILES+= trap_multi.res trap_multi.exp
.if ${TRAP_EXEC} != yes
REGRESS_SKIP_TARGETS+= trap_multi
.endif
trap_multi:
printf 'localhost\n127.0.0.1\niso.org.dod.internet.mgmt.mib_2.system.sysUpTime.0 100\n' > $@.exp
printf 'iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 iso.org.dod\n' >> $@.exp
printf 'iso.org.dod.8 "hello world"\niso.org.dod.9 42\n' >> $@.exp
> trap_output
${SNMPTRAP} -v2c -cpublic 127.0.0.1 100 1.3.6 1.3.6.8 x '68 65 6c 6c 6f 20 77 6f 72 6c 64' 1.3.6.9 i 42
# Give snmpd some time to write out the data
sleep 0.1
cp trap_output $@.res
diff -up $@.exp $@.res
.include <bsd.regress.mk>
|