xref: /openbmc/bmcweb/features/redfish/include/registries/network_device_message_registry.hpp (revision 4a102cd48c588d32c0a4d6610b4a9ed616f255f3)
140e9b92eSEd Tanous // SPDX-License-Identifier: Apache-2.0
240e9b92eSEd Tanous // SPDX-FileCopyrightText: Copyright OpenBMC Authors
3665e7602SGunnar Mills #pragma once
4665e7602SGunnar Mills /****************************************************************
5665e7602SGunnar Mills  *                 READ THIS WARNING FIRST
6665e7602SGunnar Mills  * This is an auto-generated header which contains definitions
7665e7602SGunnar Mills  * for Redfish DMTF defined messages.
8665e7602SGunnar Mills  * DO NOT modify this registry outside of running the
9665e7602SGunnar Mills  * parse_registries.py script.  The definitions contained within
10665e7602SGunnar Mills  * this file are owned by DMTF.  Any modifications to these files
11665e7602SGunnar Mills  * should be first pushed to the relevant registry in the DMTF
12665e7602SGunnar Mills  * github organization.
13665e7602SGunnar Mills  ***************************************************************/
14665e7602SGunnar Mills #include "registries.hpp"
15665e7602SGunnar Mills 
16665e7602SGunnar Mills #include <array>
17665e7602SGunnar Mills 
18665e7602SGunnar Mills // clang-format off
19665e7602SGunnar Mills 
20*4a102cd4SPatrick Williams namespace redfish::registries
21665e7602SGunnar Mills {
22*4a102cd4SPatrick Williams struct NetworkDevice
23*4a102cd4SPatrick Williams {
24*4a102cd4SPatrick Williams static constexpr Header header = {
25665e7602SGunnar Mills     "Copyright 2019-2023 DMTF. All rights reserved.",
26665e7602SGunnar Mills     "#MessageRegistry.v1_6_2.MessageRegistry",
2756b81992SEd Tanous     1,
2856b81992SEd Tanous     0,
2956b81992SEd Tanous     3,
30665e7602SGunnar Mills     "Network Device Message Registry",
31665e7602SGunnar Mills     "en",
32665e7602SGunnar Mills     "This registry defines the messages for networking devices.",
33665e7602SGunnar Mills     "NetworkDevice",
34665e7602SGunnar Mills     "DMTF",
35665e7602SGunnar Mills };
36*4a102cd4SPatrick Williams 
37*4a102cd4SPatrick Williams static constexpr const char* url =
38665e7602SGunnar Mills     "https://redfish.dmtf.org/registries/NetworkDevice.1.0.3.json";
39665e7602SGunnar Mills 
40*4a102cd4SPatrick Williams static constexpr std::array registry =
41665e7602SGunnar Mills {
42665e7602SGunnar Mills     MessageEntry{
43665e7602SGunnar Mills         "CableInserted",
44665e7602SGunnar Mills         {
45665e7602SGunnar Mills             "Indicates that a network cable was inserted.",
46665e7602SGunnar Mills             "A network cable was inserted into network adapter '%1' port '%2'.",
47665e7602SGunnar Mills             "OK",
48665e7602SGunnar Mills             2,
49665e7602SGunnar Mills             {
50665e7602SGunnar Mills                 "string",
51665e7602SGunnar Mills                 "string",
52665e7602SGunnar Mills             },
53665e7602SGunnar Mills             "None.",
54665e7602SGunnar Mills         }},
55665e7602SGunnar Mills     MessageEntry{
56665e7602SGunnar Mills         "CableRemoved",
57665e7602SGunnar Mills         {
58665e7602SGunnar Mills             "Indicates that a network cable was removed.",
59665e7602SGunnar Mills             "A cable was removed from network adapter '%1' port '%2'.",
60665e7602SGunnar Mills             "OK",
61665e7602SGunnar Mills             2,
62665e7602SGunnar Mills             {
63665e7602SGunnar Mills                 "string",
64665e7602SGunnar Mills                 "string",
65665e7602SGunnar Mills             },
66665e7602SGunnar Mills             "None.",
67665e7602SGunnar Mills         }},
68665e7602SGunnar Mills     MessageEntry{
69665e7602SGunnar Mills         "ConnectionDropped",
70665e7602SGunnar Mills         {
71665e7602SGunnar Mills             "Indicates that a network connection was dropped.",
72665e7602SGunnar Mills             "The connection is no longer active for network adapter '%1' port '%2' function '%3'.",
73665e7602SGunnar Mills             "OK",
74665e7602SGunnar Mills             3,
75665e7602SGunnar Mills             {
76665e7602SGunnar Mills                 "string",
77665e7602SGunnar Mills                 "string",
78665e7602SGunnar Mills                 "string",
79665e7602SGunnar Mills             },
80665e7602SGunnar Mills             "None.",
81665e7602SGunnar Mills         }},
82665e7602SGunnar Mills     MessageEntry{
83665e7602SGunnar Mills         "ConnectionEstablished",
84665e7602SGunnar Mills         {
85665e7602SGunnar Mills             "Indicates that a network connection was established.",
86665e7602SGunnar Mills             "A network connection was established for network adapter '%1' port '%2' function '%3'.",
87665e7602SGunnar Mills             "OK",
88665e7602SGunnar Mills             3,
89665e7602SGunnar Mills             {
90665e7602SGunnar Mills                 "string",
91665e7602SGunnar Mills                 "string",
92665e7602SGunnar Mills                 "string",
93665e7602SGunnar Mills             },
94665e7602SGunnar Mills             "None.",
95665e7602SGunnar Mills         }},
96665e7602SGunnar Mills     MessageEntry{
97665e7602SGunnar Mills         "DegradedConnectionEstablished",
98665e7602SGunnar Mills         {
99665e7602SGunnar Mills             "Indicates that a network connection was established, but at an unexpectedly low link speed.",
100665e7602SGunnar Mills             "A degraded network connection was established for network adapter '%1' port '%2' function '%3'.",
101665e7602SGunnar Mills             "Warning",
102665e7602SGunnar Mills             3,
103665e7602SGunnar Mills             {
104665e7602SGunnar Mills                 "string",
105665e7602SGunnar Mills                 "string",
106665e7602SGunnar Mills                 "string",
107665e7602SGunnar Mills             },
108665e7602SGunnar Mills             "None.",
109665e7602SGunnar Mills         }},
110665e7602SGunnar Mills     MessageEntry{
111665e7602SGunnar Mills         "LinkFlapDetected",
112665e7602SGunnar Mills         {
113665e7602SGunnar Mills             "Indicates that a network connection is highly unstable.",
114665e7602SGunnar Mills             "The network connection for network adapter '%1' port '%2' function '%3' was established and dropped '%4' times in the last '%5' minutes.",
115665e7602SGunnar Mills             "Warning",
116665e7602SGunnar Mills             5,
117665e7602SGunnar Mills             {
118665e7602SGunnar Mills                 "string",
119665e7602SGunnar Mills                 "string",
120665e7602SGunnar Mills                 "string",
121665e7602SGunnar Mills                 "number",
122665e7602SGunnar Mills                 "number",
123665e7602SGunnar Mills             },
124665e7602SGunnar Mills             "Contact the network administrator for problem resolution.",
125665e7602SGunnar Mills         }},
126665e7602SGunnar Mills 
127665e7602SGunnar Mills };
128665e7602SGunnar Mills 
129665e7602SGunnar Mills enum class Index
130665e7602SGunnar Mills {
131665e7602SGunnar Mills     cableInserted = 0,
132665e7602SGunnar Mills     cableRemoved = 1,
133665e7602SGunnar Mills     connectionDropped = 2,
134665e7602SGunnar Mills     connectionEstablished = 3,
135665e7602SGunnar Mills     degradedConnectionEstablished = 4,
136665e7602SGunnar Mills     linkFlapDetected = 5,
137665e7602SGunnar Mills };
138*4a102cd4SPatrick Williams }; // struct network_device
139*4a102cd4SPatrick Williams 
140*4a102cd4SPatrick Williams [[gnu::constructor]] inline void registerNetworkDevice()
141*4a102cd4SPatrick Williams { registerRegistry<NetworkDevice>(); }
142*4a102cd4SPatrick Williams 
143*4a102cd4SPatrick Williams } // namespace redfish::registries
144