1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef FCP_SECAGG_SERVER_SECAGG_TRACE_UTILITY_H_ 17 #define FCP_SECAGG_SERVER_SECAGG_TRACE_UTILITY_H_ 18 19 #include "fcp/secagg/server/secagg_server_enums.pb.h" 20 #include "fcp/secagg/server/tracing_schema.h" 21 #include "fcp/secagg/shared/secagg_messages.pb.h" 22 23 namespace fcp { 24 namespace secagg { 25 // Returns the ClientStatus state to be used for the context of tracing 26 TracingClientStatus ClientStatusType(ClientStatus client_status); 27 28 // Returns the ClientDropReason state to be used for the context of tracing 29 TracingClientDropReason ClientDropReasonType(ClientDropReason reason_code); 30 31 // Returns the ClientToServerWrapperMessage state 32 // to be used for the context of tracing 33 ClientToServerMessageType GetClientToServerMessageType( 34 const ClientToServerWrapperMessage& message); 35 36 // Returns the ClientToServerWrapperMessage state 37 // to be used for the context of tracing 38 ServerToClientMessageType GetServerToClientMessageType( 39 const ServerToClientWrapperMessage& message); 40 41 // Returns the SecAggServerOutcome state 42 // to be used for the context of tracing 43 TracingSecAggServerOutcome ConvertSecAccServerOutcomeToTrace( 44 SecAggServerOutcome outcome); 45 46 // Returns the SecAggServerStateKind state 47 // to be used for the context of tracing 48 SecAggServerTraceState TracingState(SecAggServerStateKind state_kind); 49 50 } // namespace secagg 51 } // namespace fcp 52 53 #endif // FCP_SECAGG_SERVER_SECAGG_TRACE_UTILITY_H_ 54