|
root / base / usr / src / uts / common / sys / sysevent
sysevent Plain Text 1366 lines 42.3 KB
   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
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
/*
 * This file and its contents are supplied under the terms of the
 * Common Development and Distribution License ("CDDL"), version 1.0.
 * You may only use this file in accordance with the terms of version
 * 1.0 of the CDDL.
 *
 * A full copy of the text of the CDDL should have accompanied this
 * source.  A copy of the CDDL is also available via the Internet at
 * http://www.illumos.org/license/CDDL.
 */

/*
 * Copyright 2015 Joyent, Inc.
 */

#ifndef _SYS_SYSEVENT_DATALINK_H
#define	_SYS_SYSEVENT_DATALINK_H

/*
 * Datalink System Event payloads
 */

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Event schema for EC_DATALINK_LINK_STATE
 *
 *	Event Class	- EC_DATALINK
 *	Event Sub-Class	- EC_DATALINK_LINK_STATE
 *
 *	Attribute Name	- DATALINK_EV_LINK_NAME
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- [Name of the datalink]
 *
 *	Attribute Name	- DATALINK_EV_LINK_ID
 *	Attribute Type	- SE_DATA_TYPE_INT32
 *	Attribute Value	- [datalink_id_t for the device]
 *
 *	Attribute Name	- DATALINK_EV_ZONE_ID
 *	Attribute Type	- SE_DATA_TYPE_INT32
 *	Attribute Value	- [zoneid_t of the zone the datalink is in]
 */

#define	DATALINK_EV_LINK_NAME		"link"
#define	DATALINK_EV_LINK_ID		"linkid"
#define	DATALINK_EV_ZONE_ID		"zone"

#ifdef __cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_DATALINK_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_SYSEVENT_DEV_H
#define	_SYS_SYSEVENT_DEV_H

#include <sys/sysevent/eventdefs.h>

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Event schema for EC_DEV_ADD/ESC_DISK
 *
 *	Event Class 	- EC_DEV_ADD
 *	Event Sub-Class - ESC_DISK
 *
 *	Attribute Name	- EV_VERSION
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- event version number
 *
 *	Attribute Name	- DEV_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- /dev name to the raw device.
 *			  The name does not include the slice number component.
 *
 *	Attribute Name	- DEV_PHYS_PATH
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- physical path of the device without the "/devices"
 *			  prefix.
 *
 *	Attribute Name	- DEV_DRIVER_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- driver name
 *
 *	Attribute Name	- DEV_INSTANCE
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- driver instance number
 *
 *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
 *	Attribute Type	- data type of the devinfo_node_property
 *	Attribute Value	- value of the devinfo_node_property
 *
 *
 * Event schema for EC_DEV_ADD/ESC_NETWORK
 *
 *	Event Class 	- EC_DEV_ADD
 *	Event Sub-Class - ESC_NETWORK
 *
 *	Attribute Name	- EV_VERSION
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- event version number
 *
 *	Attribute Name	- DEV_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- /dev name associated with the device if exists.
 *			  /dev name associated with the driver for DLPI
 *			  Style-2 only drivers.
 *
 *	Attribute Name	- DEV_PHYS_PATH
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- physical path of the device without the "/devices"
 *			  prefix.
 *
 *	Attribute Name	- DEV_DRIVER_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- driver name
 *
 *	Attribute Name	- DEV_INSTANCE
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- driver instance number
 *
 *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
 *	Attribute Type	- data type of the devinfo_node_property
 *	Attribute Value	- value of the devinfo_node_property
 *
 *
 * Event schema for EC_DEV_ADD/ESC_PRINTER
 *
 *	Event Class 	- EC_DEV_ADD
 *	Event Sub-Class - ESC_PRINTER
 *
 *	Attribute Name	- EV_VERSION
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- event version number
 *
 *	Attribute Name	- DEV_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- /dev/printers name associated with the device
 *			  if exists.
 *			  /dev name associated with the device if it exists
 *
 *	Attribute Name	- DEV_PHYS_PATH
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- physical path of the device without the "/devices"
 *			  prefix.
 *
 *	Attribute Name	- DEV_DRIVER_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- driver name
 *
 *	Attribute Name	- DEV_INSTANCE
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- driver instance number
 *
 *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
 *	Attribute Type	- data type of the devinfo_node_property
 *	Attribute Value	- value of the devinfo_node_property
 *
 *
 * Event schema for EC_DEV_REMOVE/ESC_DISK
 *
 *	Event Class 	- EC_DEV_REMOVE
 *	Event Sub-Class - ESC_DISK
 *
 *	Attribute Name	- EV_VERSION
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- event version number
 *
 *	Attribute Name	- DEV_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- /dev name to the raw device.
 *			  The name does not include the slice number component.
 *
 *	Attribute Name	- DEV_PHYS_PATH
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- physical path of the device without the "/devices"
 *			  prefix.
 *
 *	Attribute Name	- DEV_DRIVER_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- driver name
 *
 *	Attribute Name	- DEV_INSTANCE
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- driver instance number
 *
 *
 * Event schema for EC_DEV_REMOVE/ESC_NETWORK
 *
 *	Event Class 	- EC_DEV_REMOVE
 *	Event Sub-Class - ESC_NETWORK
 *
 *	Attribute Name	- EV_VERSION
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- event version number
 *
 *	Attribute Name	- DEV_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- /dev name associated with the device if exists.
 *			  /dev name associated with the driver for DLPI
 *			  Style-2 only drivers.
 *
 *	Attribute Name	- DEV_PHYS_PATH
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- physical path of the device without the "/devices"
 *			  prefix.
 *
 *	Attribute Name	- DEV_DRIVER_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- driver name
 *
 *	Attribute Name	- DEV_INSTANCE
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- driver instance number
 *
 *
 * Event schema for EC_DEV_REMOVE/ESC_PRINTER
 *
 *	Event Class 	- EC_DEV_REMOVE
 *	Event Sub-Class - ESC_PRINTER
 *
 *	Attribute Name	- EV_VERSION
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- event version number
 *
 *	Attribute Name	- DEV_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- /dev/printers name associated with the device
 *			  if exists.
 *			  /dev name associated with the device if it exists
 *
 *	Attribute Name	- DEV_PHYS_PATH
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- physical path of the device without the "/devices"
 *			  prefix.
 *
 *	Attribute Name	- DEV_DRIVER_NAME
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- driver name
 *
 *	Attribute Name	- DEV_INSTANCE
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- driver instance number
 *
 *
 * Event schema for EC_DEV_BRANCH/ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE
 *
 *	Event Class 	- EC_DEV_BRANCH
 *	Event Sub-Class - ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE
 *
 *	Attribute Name	- EV_VERSION
 *	Attribute Type	- DATA_TYPE_INT32
 *	Attribute Value	- event version number
 *
 *	Attribute Name	- DEV_PHYS_PATH
 *	Attribute Type	- DATA_TYPE_STRING
 *	Attribute Value	- physical path to the root node of the device subtree
 *			  without the "/devices" prefix.
 */

#define	EV_VERSION		"version"
#define	DEV_PHYS_PATH		"phys_path"
#define	DEV_NAME		"dev_name"
#define	DEV_DRIVER_NAME		"driver_name"
#define	DEV_INSTANCE		"instance"
#define	DEV_PROP_PREFIX		"prop-"

#define	EV_V1			1

/* maximum number of devinfo node properties added to the event */
#define	MAX_PROP_COUNT		100

/* only properties with size less than PROP_LEN_LIMIT are added to the event */
#define	PROP_LEN_LIMIT		1024

#ifdef	__cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_DEV_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2000-2002 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_SYSEVENT_DOMAIN_H
#define	_SYS_SYSEVENT_DOMAIN_H

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Event type EC_DOMAIN/ESC_DOMAIN_STATE_CHANGE schema
 *	Event Class	- EC_DOMAIN
 *	Event Sub-Class	- ESC_DOMAIN_STATE_CHANGE
 *	Event Publisher	- SUNW:kern:[domain env monitor]
 *	Attribute Name	- DOMAIN_VERSION
 *	Attribute Type	- SE_DATA_TYPE_UINT32
 *	Attribute Value	- [version of the schema]
 *	Attribute Name	- DOMAIN_WHAT_CHANGED
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- DOMAIN_RESERVED_ATTR | DOMAIN_KEYSWITCH | DOMAIN_FRU
 */
#define	DOMAIN_VERSION		"domain_version"
#define	DOMAIN_WHAT_CHANGED	"domain_what_changed"
#define	DOMAIN_KEYSWITCH	"domain_keyswitch"
#define	DOMAIN_FRU		"domain_fru"
#define	DOMAIN_RESERVED_ATTR	""

#ifdef	__cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_DOMAIN_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_SYSEVENT_DR_H
#define	_SYS_SYSEVENT_DR_H

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * dr.h contains the publicly defined sysevent attribute names and values
 * for all DR type sysevents.  Additions/removals/changes are subject to
 * PSARC approval.
 */

/*
 * Event type EC_DR/ESC_DR_AP_STATE_CHANGE event schema
 *	Event Class 	- EC_DR
 *	Event Sub-Class - ESC_DR_AP_STATE_CHANGE
 *	Event Publisher	- SUNW:kern:[dr_subsystem_name]
 *	Attribute Name	- DR_AP_ID
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- [Attachment Point Identifier]
 *	Attribute Name	- DR_HINT
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- DR_RESERVED_ATTR | DR_HINT_INSERT | DR_HINT_REMOVE
 */
#define	DR_AP_ID	"dr_ap_id"	/* Attachment point id */
#define	DR_HINT	"dr_hint"		/* Operation hint */
#define	DR_HINT_INSERT	"dr_insert"	/* Insert hint */
#define	DR_HINT_REMOVE	"dr_remove"	/* Remove hint */
#define	DR_RESERVED_ATTR	""

/*
 * Useful macros for insert/remove event.
 */
#define	SE_NO_HINT		0x0
#define	SE_HINT_INSERT		0x1
#define	SE_HINT_REMOVE		0x2
#define	SE_HINT2STR(h)		((h) == SE_HINT_INSERT ? DR_HINT_INSERT : \
				    (h) == SE_HINT_REMOVE ? DR_HINT_REMOVE : \
				    DR_RESERVED_ATTR)
/*
 * Event type EC_DR/ESC_DR_REQ event schema
 *	Event Class	- EC_DR
 *	Event Sub-Class	- ESC_DR_REQ
 *	Event Publisher	- SUNW:kern:[dr_subsystem_name]
 *	Attribute Name	- DR_AP_ID
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- [Attachment Point Name]
 *	Attribute Name	- DR_REQ_TYPE
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- DR_RESERVED_ATTR | DR_REQ_INCOMING_RES |
 *			DR_REQ_OUTGOING_RES | DR_REQ_INVESTIGATE_RES
 */
#define	DR_REQ_TYPE	"dr_request_type"	/* User request type */
#define	DR_REQ_INCOMING_RES	"dr_request_incoming_resource"
#define	DR_REQ_OUTGOING_RES	"dr_request_outgoing_resource"
#define	DR_REQ_INVESTIGATE_RES	"dr_request_investigate_resource"

#define	SE_INVESTIGATE_RES	0x0
#define	SE_INCOMING_RES		0x1
#define	SE_OUTGOING_RES		0x2
#define	SE_REQ2STR(h)		((h) == SE_INCOMING_RES ? \
					DR_REQ_INCOMING_RES : \
					(h) == SE_OUTGOING_RES ? \
					DR_REQ_OUTGOING_RES : \
					DR_REQ_INVESTIGATE_RES)
/*
 * 	Event Class 	- EC_DR
 * 	Event Sub-Class - ESC_DR_TARGET_STATE_CHANGE
 * 	Event Publisher	- SUNW:kern:<driver-name>
 * 	Attribute Name	- DR_TARGET_ID
 * 	Attribute Type	- [SE_DATA_TYPE_STRING]
 * 	Attribute Value	- </physical_path_to_hba:target>
 * 	Attribute Name	- DR_HINT
 * 	Attribute Type	- [SE_DATA_TYPE_STRING]
 * 	Attribute Value	- DR_RESERVED_ATTR | DR_HINT_INSERT | DR_HINT_REMOVE
 */
#define	DR_TARGET_ID	"dr_target_id"

#ifdef	__cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_DR_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2000-2002 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_SYSEVENT_ENV_H
#define	_SYS_SYSEVENT_ENV_H

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Event type EC_ENV/ESC_ENV_TEMP schema
 *	Event Class	- EC_ENV
 *	Event Sub-Class	- ESC_ENV_TEMP
 *	Event Publisher	- SUNW:kern:[environmental monitor name]
 *	Attribute Name	- ENV_VERSION
 *	Attribute Type	- SE_DATA_TYPE_UINT32
 *	Attribute Value	- [version of the schema]
 *	Attribute Name	- ENV_FRU_ID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Label identifying the FRU or SE_RESERVED_ATTR]
 *	Attribute Name	- ENV_FRU_RESOURCE_ID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Label identifying the Resource within the FRU or
 *			  SE_RESERVED_ATTR]
 *	Attribute Name	- ENV_FRU_DEVICE
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- ENV_RESERVED_ATTR
 *	Attribute Name	- ENV_FRU_STATE
 *	Attribute Type  - SE_DATA_TYPE_INT32
 *	Attribute Value	- ENV_OK | ENV_WARNING | ENV_FAILED
 *	Attribute Name	- ENV_MSG
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- [message passed by environmental monitor]
 */

#define	ENV_VERSION	"env_version"		/* version of the schema */
#define	ENV_FRU_ID	"env_fru_id"		/* PICL FRU name */
#define	ENV_FRU_RESOURCE_ID	"env_fru_resource_id"	/* FRU resource name */
#define	ENV_FRU_DEVICE	"env_fru_device_path"	/* Device path of sensor */
#define	ENV_FRU_STATE	"env_fru_state"		/* State of FRU */
#define	ENV_MSG		"env_msg"		/* environmental montitor msg */
#define	ENV_RESERVED_ATTR	""		/* Reserved attribute */

/*
 * Event type EC_ENV/ESC_ENV_POWER schema
 *	Event Class	- EC_ENV
 *	Event Sub-Class	- ESC_ENV_POWER
 *	Event Publisher	- SUNW:kern:[environmental monitor name]
 *	Attribute Name	- ENV_VERSION
 *	Attribute Type	- SE_DATA_TYPE_UINT32
 *	Attribute Value	- [version of the schema]
 *	Attribute Name	- ENV_FRU_ID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Label identifying the FRU or SE_RESERVED_ATTR]
 *	Attribute Name	- ENV_FRU_RESOURCE_ID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Label identifying the Resource within the FRU or
 *			   SE_RESERVED_ATTR]
 *	Attribute Name	- ENV_FRU_DEVICE
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- ENV_RESERVED_ATTR
 *	Attribute Name	- ENV_FRU_STATE
 *	Attribute Type  - SE_DATA_TYPE_INT32
 *	Attribute Value	- ENV_OK | ENV_WARNING | ENV_FAILED
 *	Attribute Name	- ENV_MSG
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- [message passed by environmental monitor]
 *
 *
 *
 * Event type EC_ENV/ESC_ENV_FAN event schema
 *	Event Class	- EC_ENV
 *	Event Sub-Class	- ESC_ENV_FAN
 *	Event Publisher	- SUNW:kern:[environmental monitor name]
 *	Attribute Name	- ENV_VERSION
 *	Attribute Type	- SE_DATA_TYPE_UINT32
 *	Attribute Value	- [version of the schema]
 *	Attribute Name	- ENV_FRU_ID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Label identifying the FRU or SE_RESERVED_ATTR]
 *	Attribute Name	- ENV_FRU_RESOURCE_ID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Label identifying the Resource within the FRU or
 *			   SE_RESERVED_ATTR]
 *	Attribute Name	- ENV_FRU_DEVICE
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- ENV_RESERVED_ATTR
 *	Attribute Name	- ENV_FRU_STATE
 *	Attribute Type  - SE_DATA_TYPE_INT32
 *	Attribute Value	- ENV_OK | ENV_WARNING | ENV_FAILED
 *	Attribute Name	- ENV_MSG
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- [message passed by environmental monitor]
 */

#define	ENV_OK		1
#define	ENV_WARNING	2
#define	ENV_FAILED	3

/*
 * Event type EC_ENV/ESC_ENV_LED event schema
 *	Event Class	- EC_ENV
 *	Event Sub-Class	- ESC_ENV_LED
 *	Event Publisher	- SUNW:kern:[environmental monitor name]
 *	Attribute Name	- ENV_VERSION
 *	Attribute Type	- SE_DATA_TYPE_UINT32
 *	Attribute Value	- [version of the schema]
 *	Attribute Name	- ENV_FRU_ID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Label identifying the FRU or SE_RESERVED_ATTR]
 *	Attribute Name	- ENV_FRU_RESOURCE_ID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Label identifying the Resource within the FRU or
 *			   SE_RESERVED_ATTR]
 *	Attribute Name	- ENV_FRU_DEVICE
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value - ENV_RESERVED_ATTR
 *	Attribute Name  - ENV_LED_COLOR
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- ENV_RESERVED_ATTR
 *	Attribute Name	- ENV_FRU_STATE
 *	Attribute Type  - SE_DATA_TYPE_INT32
 *	Attribute Value	- ENV_LED_ON | ENV_LED_OFF | ENV_LED_BLINKING |
 *			  ENV_LED_FLASHING | ENV_LED_INACCESSIBLE |
 *			  ENV_LED_STANDBY | ENV_LED_NOT_PRESENT
 *	Attribute Name	- ENV_MSG
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- [message passed by environmental monitor]
 */

#define	ENV_LED_ON		1
#define	ENV_LED_OFF		2
#define	ENV_LED_BLINKING	3
#define	ENV_LED_FLASHING	4
#define	ENV_LED_INACCESSIBLE	5
#define	ENV_LED_STANDBY		6
#define	ENV_LED_NOT_PRESENT	7

#ifdef	__cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_ENV_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */

/*
 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 * Copyright 2016 Nexenta Systems, Inc.
 * Copyright 2019 Joyent, Inc.
 * Copyright 2022 Garrett D'Amore
 */

#ifndef	_SYS_SYSEVENT_EVENTDEFS_H
#define	_SYS_SYSEVENT_EVENTDEFS_H

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * eventdefs.h contains public definitions for sysevent types (classes
 * and subclasses).  All additions/removal/changes are subject
 * to PSARC approval.
 */

/* Sysevent Class definitions */
#define	EC_NONE		"EC_none"
#define	EC_PRIV		"EC_priv"
#define	EC_PLATFORM	"EC_platform"	/* events private to platform */
#define	EC_DR		"EC_dr"	/* Dynamic reconfiguration event class */
#define	EC_ENV		"EC_env"	/* Environmental monitor event class */
#define	EC_DOMAIN	"EC_domain"	/* Domain event class */
#define	EC_IPMP		"EC_ipmp"	/* IP Multipathing event class */
#define	EC_DEV_ADD	"EC_dev_add"	/* device add event class */
#define	EC_DEV_REMOVE	"EC_dev_remove"	/* device remove event class */
#define	EC_DEV_BRANCH	"EC_dev_branch"	/* device tree branch event class */
#define	EC_DEV_STATUS	"EC_dev_status"	/* device status event class */
#define	EC_FM		"EC_fm"		/* FMA error report event */
#define	EC_ZFS		"EC_zfs"	/* ZFS event */
#define	EC_DATALINK	"EC_datalink"	/* datalink event */
#define	EC_VRRP		"EC_vrrp"	/* VRRP event */
#define	EC_PCIE		"EC_pcie"	/* PCIe event */

/*
 * The following event class is reserved for exclusive use
 * by Sun Cluster software.
 */
#define	EC_CLUSTER	"EC_Cluster"

/*
 * EC_DR subclass definitions - supporting attributes (name/value pairs)
 * are found in sys/sysevent/dr.h
 */

/* Attachment point state change */
#define	ESC_DR_AP_STATE_CHANGE	"ESC_dr_ap_state_change"
#define	ESC_DR_REQ		"ESC_dr_req"	/* Request DR */
#define	ESC_DR_TARGET_STATE_CHANGE	"ESC_dr_target_state_change"

/*
 * EC_ENV subclass definitions - supporting attributes (name/value pairs)
 * are found in sys/sysevent/env.h
 */
#define	ESC_ENV_TEMP	"ESC_env_temp"	/* Temperature change event subclass */
#define	ESC_ENV_FAN	"ESC_env_fan"	/* Fan status change event subclass */
#define	ESC_ENV_POWER	"ESC_env_power"	/* Power supply change event subclass */
#define	ESC_ENV_LED	"ESC_env_led"	/* LED change event subclass */

/*
 * EC_DOMAIN subclass definitions - supporting attributes (name/value pairs)
 * are found in sys/sysevent/domain.h
 */

/* Domain state change */
#define	ESC_DOMAIN_STATE_CHANGE		"ESC_domain_state_change"
/* Domain loghost name change */
#define	ESC_DOMAIN_LOGHOST_CHANGE	"ESC_domain_loghost_change"

/*
 * EC_IPMP subclass definitions - supporting attributes (name/value pairs)
 * are found in sys/sysevent/ipmp.h
 */

/* IPMP group has changed state */
#define	ESC_IPMP_GROUP_STATE		"ESC_ipmp_group_state"

/* IPMP group has been created or removed */
#define	ESC_IPMP_GROUP_CHANGE		"ESC_ipmp_group_change"

/* IPMP group has had an interface added or removed */
#define	ESC_IPMP_GROUP_MEMBER_CHANGE	"ESC_ipmp_group_member_change"

/* Interface within an IPMP group has changed state or type */
#define	ESC_IPMP_IF_CHANGE		"ESC_ipmp_if_change"

/* IPMP probe has changed state */
#define	ESC_IPMP_PROBE_STATE		"ESC_ipmp_probe_state"

/*
 * EC_DEV_ADD and EC_DEV_REMOVE subclass definitions - supporting attributes
 * (name/value pairs) are found in sys/sysevent/dev.h
 */
#define	ESC_DISK	"disk"		/* disk device */
#define	ESC_NETWORK	"network"	/* network interface */
#define	ESC_PRINTER	"printer"	/* printer device */
#define	ESC_LOFI	"lofi"		/* lofi device */

/*
 * EC_DEV_BRANCH subclass definitions - supporting attributes (name/value pairs)
 * are found in sys/sysevent/dev.h
 */

/* device tree branch added */
#define	ESC_DEV_BRANCH_ADD	"ESC_dev_branch_add"

/* device tree branch removed */
#define	ESC_DEV_BRANCH_REMOVE	"ESC_dev_branch_remove"

/*
 * EC_DEV_STATUS subclass definitions
 *
 * device capacity dynamically changed
 */
#define	ESC_DEV_DLE		"ESC_dev_dle"

/* LUN has received an eject request from the user */
#define	ESC_DEV_EJECT_REQUEST	"ESC_dev_eject_request"

/* FMA Fault and Error event protocol subclass */
#define	ESC_FM_ERROR		"ESC_FM_error"
#define	ESC_FM_ERROR_REPLAY	"ESC_FM_error_replay"

/* Service processor subclass definitions */
#define	ESC_PLATFORM_SP_RESET	"ESC_platform_sp_reset"

/*
 * EC_PWRCTL subclass definitions
 */
#define	EC_PWRCTL			"EC_pwrctl"
#define	ESC_PWRCTL_ADD			"ESC_pwrctl_add"
#define	ESC_PWRCTL_REMOVE		"ESC_pwrctl_remove"
#define	ESC_PWRCTL_WARN			"ESC_pwrctl_warn"
#define	ESC_PWRCTL_LOW			"ESC_pwrctl_low"
#define	ESC_PWRCTL_STATE_CHANGE		"ESC_pwrctl_state_change"
#define	ESC_PWRCTL_POWER_BUTTON		"ESC_pwrctl_power_button"
#define	ESC_PWRCTL_BRIGHTNESS_UP	"ESC_pwrctl_brightness_up"
#define	ESC_PWRCTL_BRIGHTNESS_DOWN	"ESC_pwrctl_brightness_down"

/* EC_ACPIEV subclass definitions */
#define	EC_ACPIEV			"EC_acpiev"
#define	ESC_ACPIEV_DISPLAY_SWITCH	"ESC_acpiev_display_switch"
#define	ESC_ACPIEV_SCREEN_LOCK		"ESC_acpiev_screen_lock"
#define	ESC_ACPIEV_SLEEP		"ESC_acpiev_sleep"
#define	ESC_ACPIEV_AUDIO_MUTE		"ESC_acpiev_audio_mute"
#define	ESC_ACPIEV_WIFI			"ESC_acpiev_wifi"
#define	ESC_ACPIEV_TOUCHPAD		"ESC_acpiev_touchpad"

/*
 * ZFS subclass definitions.  supporting attributes (name/value paris) are found
 * in sys/fs/zfs.h
 */
#define	ESC_ZFS_RESILVER_START		"ESC_ZFS_resilver_start"
#define	ESC_ZFS_RESILVER_FINISH		"ESC_ZFS_resilver_finish"
#define	ESC_ZFS_VDEV_REMOVE		"ESC_ZFS_vdev_remove"
#define	ESC_ZFS_VDEV_REMOVE_AUX		"ESC_ZFS_vdev_remove_aux"
#define	ESC_ZFS_VDEV_REMOVE_DEV		"ESC_ZFS_vdev_remove_dev"
#define	ESC_ZFS_POOL_CREATE		"ESC_ZFS_pool_create"
#define	ESC_ZFS_POOL_DESTROY		"ESC_ZFS_pool_destroy"
#define	ESC_ZFS_POOL_IMPORT		"ESC_ZFS_pool_import"
#define	ESC_ZFS_VDEV_ADD		"ESC_ZFS_vdev_add"
#define	ESC_ZFS_VDEV_ATTACH		"ESC_ZFS_vdev_attach"
#define	ESC_ZFS_VDEV_CLEAR		"ESC_ZFS_vdev_clear"
#define	ESC_ZFS_VDEV_CHECK		"ESC_ZFS_vdev_check"
#define	ESC_ZFS_VDEV_ONLINE		"ESC_ZFS_vdev_online"
#define	ESC_ZFS_CONFIG_SYNC		"ESC_ZFS_config_sync"
#define	ESC_ZFS_SCRUB_START		"ESC_ZFS_scrub_start"
#define	ESC_ZFS_SCRUB_FINISH		"ESC_ZFS_scrub_finish"
#define	ESC_ZFS_SCRUB_ABORT		"ESC_ZFS_scrub_abort"
#define	ESC_ZFS_SCRUB_RESUME		"ESC_ZFS_scrub_resume"
#define	ESC_ZFS_SCRUB_PAUSED		"ESC_ZFS_scrub_paused"
#define	ESC_ZFS_VDEV_SPARE		"ESC_ZFS_vdev_spare"
#define	ESC_ZFS_BOOTFS_VDEV_ATTACH	"ESC_ZFS_bootfs_vdev_attach"
#define	ESC_ZFS_POOL_REGUID		"ESC_ZFS_pool_reguid"
#define	ESC_ZFS_HISTORY_EVENT		"ESC_ZFS_history_event"
#define	ESC_ZFS_TRIM_START		"ESC_ZFS_trim_start"
#define	ESC_ZFS_TRIM_FINISH		"ESC_ZFS_trim_finish"
#define	ESC_ZFS_TRIM_CANCEL		"ESC_ZFS_trim_cancel"
#define	ESC_ZFS_TRIM_RESUME		"ESC_ZFS_trim_resume"
#define	ESC_ZFS_TRIM_SUSPEND		"ESC_ZFS_trim_suspend"

/*
 * datalink subclass definitions. Supporting attributes for datalink state found
 * in sys/sysevent/datalink.h.
 */
#define	ESC_DATALINK_PHYS_ADD	"ESC_datalink_phys_add"	/* new physical link */
#define	ESC_DATALINK_LINK_STATE	"ESC_datalink_link_state"	/* link state */

/*
 * VRRP subclass definitions. Supporting attributes (name/value paris) are
 * found in sys/sysevent/vrrp.h
 */
#define	ESC_VRRP_STATE_CHANGE	"ESC_vrrp_state_change"

/*
 * PCIe subclass definitions. Supporting attributes for PCIe state found in
 * sys/sysevent/pcie.h.
 */
#define	ESC_PCIE_LINK_STATE	"ESC_pcie_link_state"

#ifdef	__cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_EVENTDEFS_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_SYSEVENT_IPMP_H
#define	_SYS_SYSEVENT_IPMP_H

/*
 * IPMP sysevent definitions.  Note that all of these definitions are
 * Sun-private and are subject to change at any time.
 */

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Event channel associated with these events
 */
#define	IPMP_EVENT_CHAN "com.sun:ipmp:events"

/*
 * Event type EC_IPMP/ESC_IPMP_GROUP_STATE event schema
 *
 *	Event Class     - EC_IPMP
 *	Event Sub-Class - ESC_IPMP_GROUP_STATE
 *	Event Vendor	- com.sun
 *	Event Publisher - in.mpathd
 *
 * 	Attribute Name  - IPMP_EVENT_VERSION
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <version>
 *
 *	Attribute Name  - IPMP_GROUP_NAME
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value - <group-name>
 *
 *	Attribute Name  - IPMP_GROUP_SIGNATURE
 *	Attribute Type  - SE_DATA_TYPE_UINT64
 * 	Attribute Value - <group-signature>
 *
 *	Attribute Name  - IPMP_GROUP_STATE
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <group-state>
 */

#define	IPMP_EVENT_VERSION	"ipmp_event_version"
#define	IPMP_GROUP_NAME		"ipmp_group_name"
#define	IPMP_GROUP_SIGNATURE	"ipmp_group_signature"
#define	IPMP_GROUP_STATE	"ipmp_group_state"

typedef enum {
	IPMP_GROUP_OK,		/* all interfaces in the group are ok */
	IPMP_GROUP_FAILED,	/* all interfaces in the group are unusable */
	IPMP_GROUP_DEGRADED	/* some interfaces in the group are unusable */
} ipmp_group_state_t;

#define	IPMP_EVENT_CUR_VERSION	2

/*
 * Event type EC_IPMP/ESC_IPMP_GROUP_CHANGE event schema
 *
 *	Event Class     - EC_IPMP
 *	Event Sub-Class - ESC_IPMP_GROUP_CHANGE
 *	Event Vendor	- com.sun
 *	Event Publisher - in.mpathd
 *
 *	Attribute Name  - IPMP_GROUP_NAME
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value - <group-name>
 *
 *	Attribute Name  - IPMP_EVENT_VERSION
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <version>
 *
 *	Attribute Name  - IPMP_GROUPLIST_SIGNATURE
 *	Attribute Type  - SE_DATA_TYPE_UINT64
 *	Attribute Value - <grouplist-signature>
 *
 *	Attribute Name  - IPMP_GROUP_OPERATION
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <group-change-op>
 */

#define	IPMP_GROUPLIST_SIGNATURE	"ipmp_grouplist_signature"
#define	IPMP_GROUP_OPERATION		"ipmp_group_operation"

typedef enum {
	IPMP_GROUP_ADD,		/* a new IPMP group has been created */
	IPMP_GROUP_REMOVE	/* an existing IPMP group has been removed */
} ipmp_group_op_t;

/*
 * Event type EC_IPMP/ESC_IPMP_GROUP_MEMBER event schema
 *
 *	Event Class     - EC_IPMP
 *	Event Sub-Class - ESC_IPMP_GROUP_MEMBER_CHANGE
 *	Event Vendor	- com.sun
 *	Event Publisher - in.mpathd
 *
 *	Attribute Name  - IPMP_GROUP_NAME
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value - <group-name>
 *
 *	Attribute Name  - IPMP_EVENT_VERSION
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <version>
 *
 *	Attribute Name  - IPMP_GROUP_SIGNATURE
 *	Attribute Type  - SE_DATA_TYPE_UINT64
 *	Attribute Value - <group-signature>
 *
 *	Attribute Name  - IPMP_IF_OPERATION
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <interface-op>
 *
 *	Attribute Name  - IPMP_IF_NAME
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value - <if-name>
 *
 *	Attribute Name  - IPMP_IF_TYPE
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <if-type>
 *
 *	Attribute Name  - IPMP_IF_STATE
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <if-state>
 */

#define	IPMP_IF_OPERATION	"ipmp_if_operation"
#define	IPMP_IF_NAME		"ipmp_if_name"
#define	IPMP_IF_TYPE		"ipmp_if_type"
#define	IPMP_IF_STATE		"ipmp_if_state"

typedef enum {
	IPMP_IF_ADD,		/* a new interface has joined the group */
	IPMP_IF_REMOVE 		/* an existing interface has left the group */
} ipmp_if_op_t;

typedef enum {
	IPMP_IF_STANDBY,	/* the interface is a standby */
	IPMP_IF_NORMAL 		/* the interface is not a standby */
} ipmp_if_type_t;

typedef enum {
	IPMP_IF_OK,		/* the interface is functional */
	IPMP_IF_FAILED,		/* the interface is in a failed state */
	IPMP_IF_OFFLINE,	/* the interface is offline */
	IPMP_IF_UNKNOWN		/* the interface may or may not be ok */
} ipmp_if_state_t;		/* (not enough probes have been sent) */

/*
 * Event type EC_IPMP/ESC_IPMP_IF_CHANGE event schema
 *
 *	Event Class     - EC_IPMP
 *	Event Sub-Class - ESC_IPMP_IF_CHANGE
 *	Event Vendor	- com.sun
 *	Event Publisher - in.mpathd
 *
 *	Attribute Name  - IPMP_GROUP_NAME
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value - <group-name>
 *
 *	Attribute Name  - IPMP_EVENT_VERSION
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <version>
 *
 *	Attribute Name  - IPMP_GROUP_SIGNATURE
 *	Attribute Type  - SE_DATA_TYPE_UINT64
 *	Attribute Value - <group-signature>
 *
 *	Attribute Name  - IPMP_IF_NAME
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value - <if-name>
 *
 *	Attribute Name  - IPMP_IF_STATE
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <if-state>
 *
 *	Attribute Name  - IPMP_IF_TYPE
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <if-type>
 */

#define	IPMP_PROBE_ID			"ipmp_probe_id"
#define	IPMP_PROBE_STATE		"ipmp_probe_state"
#define	IPMP_PROBE_START_TIME		"ipmp_probe_start_time"
#define	IPMP_PROBE_SENT_TIME		"ipmp_probe_sent_time"
#define	IPMP_PROBE_ACKRECV_TIME		"ipmp_probe_ackrecv_time"
#define	IPMP_PROBE_ACKPROC_TIME		"ipmp_probe_ackproc_time"
#define	IPMP_PROBE_TARGET		"ipmp_probe_target"
#define	IPMP_PROBE_TARGET_RTTAVG	"ipmp_probe_target_rttavg"
#define	IPMP_PROBE_TARGET_RTTDEV	"ipmp_probe_target_rttdev"

typedef enum {
	IPMP_PROBE_SENT,	/* the probe has been sent */
	IPMP_PROBE_ACKED,	/* the probe has been acked */
	IPMP_PROBE_LOST		/* the probe has been lost */
} ipmp_probe_state_t;

/*
 * Event type EC_IPMP/ESC_IPMP_PROBE_STATE event schema
 *
 *	Event Class     - EC_IPMP
 *	Event Sub-Class - ESC_IPMP_PROBE_STATE
 *	Event Vendor	- com.sun
 *	Event Publisher - in.mpathd
 *
 *	Attribute Name  - IPMP_PROBE_ID
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <probe-id>
 *
 *	Attribute Name  - IPMP_EVENT_VERSION
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <version>
 *
 *	Attribute Name  - IPMP_IF_NAME
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value - <if-name>
 *
 *	Attribute Name  - IPMP_PROBE_STATE
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <probe-state>
 *
 *	Attribute Name  - IPMP_PROBE_START_TIME
 *	Attribute Type  - SE_DATA_TYPE_TIME
 *	Attribute Value - <probe-start-time>
 *
 *	Attribute Name  - IPMP_PROBE_SENT_TIME
 *	Attribute Type  - SE_DATA_TYPE_TIME
 *	Attribute Value - <probe-sent-time>
 *
 *	Attribute Name  - IPMP_PROBE_ACKRECV_TIME
 *	Attribute Type  - SE_DATA_TYPE_TIME
 *	Attribute Value - <probe-ackrecv-time>
 *
 *	Attribute Name  - IPMP_PROBE_ACKPROC_TIME
 *	Attribute Type  - SE_DATA_TYPE_TIME
 *	Attribute Value - <probe-ackproc-time>
 *
 *	Attribute Name  - IPMP_PROBE_TARGET
 *	Attribute Type  - SE_DATA_TYPE_BYTES
 *	Attribute Value - <probe-target-ip>
 *
 *	Attribute Name  - IPMP_PROBE_TARGET_RTTAVG
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <probe-target-rttavg>
 *
 *	Attribute Name  - IPMP_PROBE_TARGET_RTTDEV
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value - <probe-target-rttdev>
 */

#ifdef __cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_IPMP_H */
/*
 * This file and its contents are supplied under the terms of the
 * Common Development and Distribution License ("CDDL"), version 1.0.
 * You may only use this file in accordance with the terms of version
 * 1.0 of the CDDL.
 *
 * A full copy of the text of the CDDL should have accompanied this
 * source.  A copy of the CDDL is also available via the Internet at
 * http://www.illumos.org/license/CDDL.
 */

/*
 * Copyright 2019 Joyent, Inc.
 */

#ifndef _SYS_SYSEVENT_PCIE_H
#define	_SYS_SYSEVENT_PCIE_H

/*
 * PCIe System Event payloads
 */

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Event schema for ESC_PCIE_LINK_STATE
 *
 *	Event Class	- EC_PCIE
 *	Event Sub-Class	- ESC_PCIE_LINK_STATE
 *
 *	Attribute Name	- PCIE_EV_DETECTOR_PATH
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- [devfs path of the node that detected the change]
 *
 *	Attribute Name	- PCIE_EV_CHILD_PATH
 *	Attribute Type	- SE_DATA_TYPE_STRING
 *	Attribute Value	- [devfs path of the updated child]
 *
 *	Attribute Name	- PCIE_EV_DETECTOR_FLAGS
 *	Attribute Type	- SE_DATA_TYPE_UINT64
 *	Attribute Value	- [PCIe flags that indicate the type of change]
 */

#define	PCIE_EV_DETECTOR_PATH	"detector_path"
#define	PCIE_EV_CHILD_PATH	"child_path"
#define	PCIE_EV_DETECTOR_FLAGS	"detector_flags"

#define	PCIE_EV_DETECTOR_FLAGS_LBMS	0x01
#define	PCIE_EV_DETECTOR_FLAGS_LABS	0x02

#ifdef __cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_PCIE_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_SYSEVENT_PWRCTL_H
#define	_SYS_SYSEVENT_PWRCTL_H

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Event type schema for EC_PWRCTL:
 *	Event Class	- EC_PWRCTL
 *	Event Sub-Class	- ESC_PWRCTL_ADD |
 *                        ESC_PWRCTL_REMOVE |
 *                        ESC_PWRCTL_WARN |
 *                        ESC_PWRCTL_LOW |
 *                        ESC_PWRCTL_STATE_CHANGE |
 *			  ESC_PWRCTL_POWER_BUTTON |
 *			  ESC_PWRCTL_BRIGHTNESS_UP |
 *			  ESC_PWRCTL_BRIGHTNESS_DOWN
 *	Event Publisher	- SUNW:kern:[environmental monitor name]
 *	Attribute Name	- PWRCTL_VERSION
 *	Attribute Type	- SE_DATA_TYPE_UINT32
 *	Attribute Value	- [version of the schema]
 *	Attribute Name	- PWRCTL_DEV_HID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Label identifying the ACPI hardware]
 *	Attribute Name	- PWRCTL_DEV_UID
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value	- [Both the _HID and _UID values can be of either type
 *	                   STRING or NUMBER in the ACPI tables. In order to
 *	                   provide a consistent data type in the external
 *	                   interface, these values are always returned as NULL
 *	                   terminated strings, regardless of the original data
 *	                   type in the source ACPI table.]
 *	Attribute Name	- PWRCTL_DEV_INDEX
 *	Attribute Type	- SE_DATA_TYPE_UINT32
 *	Attribute Value	- [Device index]
 *
 * ESC_PWRCTL_WARN, ESC_PWRCTL_LOW only field:
 *	Attribute Name	- PWRCTL_CHARGE_LEVEL
 *	Attribute Type  - SE_DATA_TYPE_UINT32
 *	Attribute Value	- [charge level]
 */

#define	PWRCTL_VERSION		"pwrctl_version" /* Version of the schema */
#define	PWRCTL_DEV_PHYS_PATH	"pwrctl_dev_phys_path" /* Physical Path */
#define	PWRCTL_DEV_HID		"pwrctl_dev_hid" /* ACPI device Hardware Id */
#define	PWRCTL_DEV_UID		"pwrctl_dev_uid" /* ACPI device Unique Id */
#define	PWRCTL_DEV_INDEX	"pwrctl_dev_index" /* Device index */
#define	PWRCTL_CHARGE_LEVEL	"pwrctl_charge_level" /* Event related state */
#define	PWRCTL_BRIGHTNESS_LEVEL	"pwrctl_brightness_level"

#ifdef	__cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_PWRCTL_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_SYSEVENT_VRRP_H
#define	_SYS_SYSEVENT_VRRP_H

/*
 * VRRP sysevent definitions.  Note that all of these definitions are
 * Sun-private and are subject to change at any time.
 */

#ifdef __cplusplus
extern "C" {
#endif


/*
 * Event type EC_VRRP/ESC_VRRP_GROUP_STATE event schema
 *
 *	Event Class     - EC_VRRP
 *	Event Sub-Class - ESC_VRRP_STATE_CHANGE
 *	Event Vendor	- SUNW_VENDOR		(defined in sys/sysevent.h)
 *	Event Publisher - VRRP_EVENT_PUBLISHER	(defined in this file)
 *
 * 	Attribute Name  - VRRP_EVENT_VERSION
 *	Attribute Type  - SE_DATA_TYPE_UINT8
 *	Attribute Value - <version>
 *
 *	Attribute Name  - VRRP_EVENT_ROUTER_NAME
 *	Attribute Type  - SE_DATA_TYPE_STRING
 *	Attribute Value - <router-name>
 *
 *	Attribute Name  - VRRP_EVENT_STATE
 *	Attribute Type  - SE_DATA_TYPE_UINT8
 * 	Attribute Value - <state>
 *
 *	Attribute Name  - VRRP_EVENT_PREV_STATE
 *	Attribute Type  - SE_DATA_TYPE_UINT8
 * 	Attribute Value - <previous-state>
 */

#define	VRRP_EVENT_PUBLISHER	"vrrpd"

#define	VRRP_EVENT_VERSION	"vrrp_event_version"
#define	VRRP_EVENT_ROUTER_NAME	"vrrp_router_name"
#define	VRRP_EVENT_STATE	"vrrp_state"
#define	VRRP_EVENT_PREV_STATE	"vrrp_prev_state"

#define	VRRP_EVENT_CUR_VERSION	1


#ifdef __cplusplus
}
#endif

#endif /* _SYS_SYSEVENT_VRRP_H */