clang-format QUICHE
Run clang-format on *.h and *.cc file in QUICHE.
Tested:
TAP --sample ran all affected tests and none failed
http://test/OCL:441020521:BASE:441009081:1649718160653:cec8e71b
PiperOrigin-RevId: 441178713
diff --git a/quiche/quic/qbone/bonnet/icmp_reachable.cc b/quiche/quic/qbone/bonnet/icmp_reachable.cc
index ee67cf2..fac964b 100644
--- a/quiche/quic/qbone/bonnet/icmp_reachable.cc
+++ b/quiche/quic/qbone/bonnet/icmp_reachable.cc
@@ -27,10 +27,8 @@
const char kUnknownSource[] = "UNKNOWN";
const char kNoSource[] = "N/A";
-IcmpReachable::IcmpReachable(QuicIpAddress source,
- QuicIpAddress destination,
- absl::Duration timeout,
- KernelInterface* kernel,
+IcmpReachable::IcmpReachable(QuicIpAddress source, QuicIpAddress destination,
+ absl::Duration timeout, KernelInterface* kernel,
QuicEpollServer* epoll_server,
StatsInterface* stats)
: timeout_(timeout),
diff --git a/quiche/quic/qbone/bonnet/icmp_reachable.h b/quiche/quic/qbone/bonnet/icmp_reachable.h
index 74189b1..a4ecdee 100644
--- a/quiche/quic/qbone/bonnet/icmp_reachable.h
+++ b/quiche/quic/qbone/bonnet/icmp_reachable.h
@@ -64,12 +64,9 @@
// Server's thread.
// |stats| is not owned, but should outlive this instance. It will be called
// back on Echo Replies, timeouts, and I/O errors.
- IcmpReachable(QuicIpAddress source,
- QuicIpAddress destination,
- absl::Duration timeout,
- KernelInterface* kernel,
- QuicEpollServer* epoll_server,
- StatsInterface* stats);
+ IcmpReachable(QuicIpAddress source, QuicIpAddress destination,
+ absl::Duration timeout, KernelInterface* kernel,
+ QuicEpollServer* epoll_server, StatsInterface* stats);
~IcmpReachable() override;
@@ -93,8 +90,7 @@
EpollCallback(EpollCallback&&) = delete;
EpollCallback& operator=(EpollCallback&&) = delete;
- void OnRegistration(QuicEpollServer* eps,
- int fd,
+ void OnRegistration(QuicEpollServer* eps, int fd,
int event_mask) override{};
void OnModification(int fd, int event_mask) override{};
diff --git a/quiche/quic/qbone/bonnet/tun_device.cc b/quiche/quic/qbone/bonnet/tun_device.cc
index 85a25fa..9b11d99 100644
--- a/quiche/quic/qbone/bonnet/tun_device.cc
+++ b/quiche/quic/qbone/bonnet/tun_device.cc
@@ -15,9 +15,7 @@
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/qbone/platform/kernel_interface.h"
-ABSL_FLAG(std::string,
- qbone_client_tun_device_path,
- "/dev/net/tun",
+ABSL_FLAG(std::string, qbone_client_tun_device_path, "/dev/net/tun",
"The path to the QBONE client's TUN device.");
namespace quic {
diff --git a/quiche/quic/qbone/bonnet/tun_device_controller.cc b/quiche/quic/qbone/bonnet/tun_device_controller.cc
index 6ec912f..80c1909 100644
--- a/quiche/quic/qbone/bonnet/tun_device_controller.cc
+++ b/quiche/quic/qbone/bonnet/tun_device_controller.cc
@@ -59,8 +59,7 @@
}
bool TunDeviceController::UpdateRoutes(
- const IpRange& desired_range,
- const std::vector<IpRange>& desired_routes) {
+ const IpRange& desired_range, const std::vector<IpRange>& desired_routes) {
if (!setup_tun_) {
return true;
}
@@ -81,10 +80,9 @@
for (const auto& rule : routing_rules) {
if (rule.out_interface == link_info.index &&
rule.table == QboneConstants::kQboneRouteTableId) {
- if (!netlink_->ChangeRoute(NetlinkInterface::Verb::kRemove,
- rule.table, rule.destination_subnet,
- rule.scope, rule.preferred_source,
- rule.out_interface)) {
+ if (!netlink_->ChangeRoute(NetlinkInterface::Verb::kRemove, rule.table,
+ rule.destination_subnet, rule.scope,
+ rule.preferred_source, rule.out_interface)) {
QUIC_LOG(ERROR) << "Unable to remove old route to <"
<< rule.destination_subnet.ToString() << ">";
return false;
@@ -115,8 +113,7 @@
}
bool TunDeviceController::UpdateRoutesWithRetries(
- const IpRange& desired_range,
- const std::vector<IpRange>& desired_routes,
+ const IpRange& desired_range, const std::vector<IpRange>& desired_routes,
int retries) {
while (retries-- > 0) {
if (UpdateRoutes(desired_range, desired_routes)) {
@@ -140,8 +137,8 @@
for (const auto& rule : ip_rules) {
if (rule.table == QboneConstants::kQboneRouteTableId) {
- if (!netlink_->ChangeRule(NetlinkInterface::Verb::kRemove,
- rule.table, rule.source_range)) {
+ if (!netlink_->ChangeRule(NetlinkInterface::Verb::kRemove, rule.table,
+ rule.source_range)) {
QUIC_LOG(ERROR) << "Unable to remove old rule for table <" << rule.table
<< "> from source <" << rule.source_range.ToString()
<< ">";
diff --git a/quiche/quic/qbone/bonnet/tun_device_controller.h b/quiche/quic/qbone/bonnet/tun_device_controller.h
index 633ec60..3043583 100644
--- a/quiche/quic/qbone/bonnet/tun_device_controller.h
+++ b/quiche/quic/qbone/bonnet/tun_device_controller.h
@@ -46,8 +46,7 @@
//
// TODO(b/179430548): Remove this once we've root-caused the underlying issue.
virtual bool UpdateRoutesWithRetries(
- const IpRange& desired_range,
- const std::vector<IpRange>& desired_routes,
+ const IpRange& desired_range, const std::vector<IpRange>& desired_routes,
int retries);
virtual void RegisterAddressUpdateCallback(
diff --git a/quiche/quic/qbone/bonnet/tun_device_controller_test.cc b/quiche/quic/qbone/bonnet/tun_device_controller_test.cc
index 7b5bb51..65daa15 100644
--- a/quiche/quic/qbone/bonnet/tun_device_controller_test.cc
+++ b/quiche/quic/qbone/bonnet/tun_device_controller_test.cc
@@ -52,12 +52,11 @@
protected:
void ExpectLinkInfo(const std::string& interface_name, int ifindex) {
EXPECT_CALL(netlink_, GetLinkInfo(interface_name, _))
- .WillOnce(
- Invoke([ifindex](absl::string_view ifname,
- NetlinkInterface::LinkInfo* link_info) {
- link_info->index = ifindex;
- return true;
- }));
+ .WillOnce(Invoke([ifindex](absl::string_view ifname,
+ NetlinkInterface::LinkInfo* link_info) {
+ link_info->index = ifindex;
+ return true;
+ }));
}
MockNetlink netlink_;
@@ -87,23 +86,22 @@
ExpectLinkInfo(kIfname, kIfindex);
EXPECT_CALL(netlink_, GetAddresses(kIfindex, _, _, _))
- .WillOnce(
- Invoke([](int interface_index, uint8_t unwanted_flags,
- std::vector<NetlinkInterface::AddressInfo>* addresses,
- int* num_ipv6_nodad_dadfailed_addresses) {
- NetlinkInterface::AddressInfo info{};
- info.interface_address.FromString(kOldAddress);
- info.prefix_length = kOldPrefixLen;
- addresses->emplace_back(info);
- return true;
- }));
+ .WillOnce(Invoke([](int interface_index, uint8_t unwanted_flags,
+ std::vector<NetlinkInterface::AddressInfo>* addresses,
+ int* num_ipv6_nodad_dadfailed_addresses) {
+ NetlinkInterface::AddressInfo info{};
+ info.interface_address.FromString(kOldAddress);
+ info.prefix_length = kOldPrefixLen;
+ addresses->emplace_back(info);
+ return true;
+ }));
QuicIpAddress old_address;
old_address.FromString(kOldAddress);
- EXPECT_CALL(netlink_, ChangeLocalAddress(
- kIfindex, NetlinkInterface::Verb::kRemove,
- old_address, kOldPrefixLen, _, _, _))
+ EXPECT_CALL(netlink_,
+ ChangeLocalAddress(kIfindex, NetlinkInterface::Verb::kRemove,
+ old_address, kOldPrefixLen, _, _, _))
.WillOnce(Return(true));
EXPECT_CALL(netlink_,
@@ -122,8 +120,8 @@
const int num_matching_routes = 3;
EXPECT_CALL(netlink_, GetRouteInfo(_))
- .WillOnce(Invoke(
- [](std::vector<NetlinkInterface::RoutingRule>* routing_rules) {
+ .WillOnce(
+ Invoke([](std::vector<NetlinkInterface::RoutingRule>* routing_rules) {
NetlinkInterface::RoutingRule non_matching_route;
non_matching_route.table = QboneConstants::kQboneRouteTableId;
non_matching_route.out_interface = kIfindex + 1;
@@ -137,16 +135,15 @@
}
NetlinkInterface::RoutingRule non_matching_table;
- non_matching_table.table =
- QboneConstants::kQboneRouteTableId + 1;
+ non_matching_table.table = QboneConstants::kQboneRouteTableId + 1;
non_matching_table.out_interface = kIfindex;
routing_rules->push_back(non_matching_table);
return true;
}));
EXPECT_CALL(netlink_, ChangeRoute(NetlinkInterface::Verb::kRemove,
- QboneConstants::kQboneRouteTableId, _,
- _, _, kIfindex))
+ QboneConstants::kQboneRouteTableId, _, _, _,
+ kIfindex))
.Times(num_matching_routes)
.WillRepeatedly(Return(true));
@@ -241,8 +238,7 @@
public:
DisabledTunDeviceControllerTest()
: controller_(kIfname, false, &netlink_),
- link_local_range_(
- *QboneConstants::TerminatorLocalAddressRange()) {}
+ link_local_range_(*QboneConstants::TerminatorLocalAddressRange()) {}
StrictMock<MockNetlink> netlink_;
TunDeviceController controller_;
diff --git a/quiche/quic/qbone/bonnet/tun_device_packet_exchanger.h b/quiche/quic/qbone/bonnet/tun_device_packet_exchanger.h
index 4751fb8..2417d50 100644
--- a/quiche/quic/qbone/bonnet/tun_device_packet_exchanger.h
+++ b/quiche/quic/qbone/bonnet/tun_device_packet_exchanger.h
@@ -61,9 +61,7 @@
std::string* error) override;
// From QbonePacketExchanger.
- bool WritePacket(const char* packet,
- size_t size,
- bool* blocked,
+ bool WritePacket(const char* packet, size_t size, bool* blocked,
std::string* error) override;
std::unique_ptr<QuicData> ApplyL2Headers(const QuicData& l3_packet);