1 /* 2 * Copyright 2018 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 17 #ifndef FCP_SECAGG_SERVER_SEND_TO_CLIENTS_INTERFACE_H_ 18 #define FCP_SECAGG_SERVER_SEND_TO_CLIENTS_INTERFACE_H_ 19 20 #include "fcp/secagg/shared/secagg_messages.pb.h" 21 22 namespace fcp { 23 namespace secagg { 24 25 // Used to provide a SecAggServer with a private and authenticated channel with 26 // the clients, which can be used to send protocol buffer messages. 27 28 class SendToClientsInterface { 29 public: 30 // Sends the message to all of the active clients involved in the current 31 // protocol session. 32 virtual void SendBroadcast(const ServerToClientWrapperMessage& message) = 0; 33 34 // Sends a message to a single client. 35 virtual void Send(uint32_t recipient_id, 36 const ServerToClientWrapperMessage& message) = 0; 37 38 virtual ~SendToClientsInterface() = default; 39 }; 40 41 } // namespace secagg 42 } // namespace fcp 43 44 #endif // FCP_SECAGG_SERVER_SEND_TO_CLIENTS_INTERFACE_H_ 45