Skip to content

Commit 46d944d

Browse files
CEL Dev Teamcopybara-github
authored andcommitted
Internal Change
PiperOrigin-RevId: 853775186
1 parent 13b249f commit 46d944d

File tree

9 files changed

+2685
-0
lines changed

9 files changed

+2685
-0
lines changed

internal/BUILD

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,59 @@ cc_library(
131131
deps = ["@com_google_absl//absl/base:config"],
132132
)
133133

134+
cc_library(
135+
name = "ipaddress_oss",
136+
srcs = ["ipaddress_oss.cc"],
137+
hdrs = ["ipaddress_oss.h"],
138+
deps = [
139+
"@com_google_absl//absl/base:core_headers",
140+
"@com_google_absl//absl/log",
141+
"@com_google_absl//absl/log:absl_check",
142+
"@com_google_absl//absl/log:absl_log",
143+
"@com_google_absl//absl/log:check",
144+
"@com_google_absl//absl/numeric:int128",
145+
"@com_google_absl//absl/status",
146+
"@com_google_absl//absl/status:statusor",
147+
"@com_google_absl//absl/strings",
148+
"@com_google_absl//absl/strings:str_format",
149+
],
150+
)
151+
152+
cc_library(
153+
name = "ipaddress_util_oss",
154+
srcs = ["ipaddress_util_oss.cc"],
155+
hdrs = ["ipaddress_util_oss.h"],
156+
deps = [
157+
":ipaddress_oss",
158+
"@com_google_absl//absl/log:absl_check",
159+
],
160+
)
161+
162+
cc_test(
163+
name = "ipaddress_oss_test",
164+
srcs = ["ipaddress_oss_test.cc"],
165+
deps = [
166+
":ipaddress_oss",
167+
":testing",
168+
"@com_google_absl//absl/log:absl_check",
169+
"@com_google_absl//absl/numeric:int128",
170+
"@com_google_absl//absl/status",
171+
"@com_google_absl//absl/status:status_matchers",
172+
"@com_google_absl//absl/strings",
173+
"@com_google_absl//absl/strings:str_format",
174+
],
175+
)
176+
177+
cc_test(
178+
name = "ipaddress_util_oss_test",
179+
srcs = ["ipaddress_util_oss_test.cc"],
180+
deps = [
181+
":ipaddress_oss",
182+
":ipaddress_util_oss",
183+
":testing",
184+
],
185+
)
186+
134187
cc_library(
135188
name = "status_macros",
136189
hdrs = ["status_macros.h"],

internal/ipaddress.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef THIRD_PARTY_CEL_CPP_INTERNAL_IPADDRESS_H_
16+
#define THIRD_PARTY_CEL_CPP_INTERNAL_IPADDRESS_H_
17+
18+
// copybara:strip_begin(ipaddress)
19+
#include "net/base/ipaddress.h"
20+
/* copybara:strip_end_and_replace
21+
#include "internal/ipaddress_oss.h"
22+
*/
23+
24+
// copybara:strip_begin(ipaddress)
25+
namespace cel::internal {
26+
using ::net_base::IPAddress;
27+
using ::net_base::IPRange;
28+
29+
using ::net_base::GetMappedIPv4Address;
30+
using ::net_base::HostUInt32ToIPAddress;
31+
using ::net_base::IPAddressToHostUInt32;
32+
using ::net_base::IsAnyIPAddress;
33+
using ::net_base::IsLoopbackIPAddress;
34+
using ::net_base::IsProperSubRange;
35+
using ::net_base::IsV4MulticastIPAddress;
36+
using ::net_base::PackedStringToIPAddress;
37+
using ::net_base::StringToIPAddress;
38+
using ::net_base::StringToIPRangeAndTruncate;
39+
} // namespace cel::internal
40+
// copybara:strip_end
41+
42+
#endif // THIRD_PARTY_CEL_CPP_INTERNAL_IPADDRESS_H_

0 commit comments

Comments
 (0)