• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# 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, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load("@rules_cc//cc:cc_library.bzl", "cc_library")
16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
17load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
18load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
19
20package(
21    default_visibility = ["//visibility:public"],
22    features = ["-layering_check"],
23)
24
25licenses(["notice"])
26
27cc_library(
28    name = "static_router",
29    srcs = ["static_router.cc"],
30    hdrs = ["public/pw_router/static_router.h"],
31    strip_include_prefix = "public",
32    deps = [
33        ":egress",
34        ":packet_parser",
35        "//pw_log",
36        "//pw_metric:metric",
37    ],
38)
39
40cc_library(
41    name = "egress",
42    hdrs = ["public/pw_router/egress.h"],
43    strip_include_prefix = "public",
44    deps = [
45        ":packet_parser",
46        "//pw_bytes",
47    ],
48)
49
50cc_library(
51    name = "packet_parser",
52    hdrs = ["public/pw_router/packet_parser.h"],
53    strip_include_prefix = "public",
54    deps = ["//pw_bytes"],
55)
56
57cc_library(
58    name = "egress_function",
59    hdrs = ["public/pw_router/egress_function.h"],
60    strip_include_prefix = "public",
61    deps = [
62        ":egress",
63        "//pw_function",
64    ],
65)
66
67pw_cc_test(
68    name = "static_router_test",
69    srcs = ["static_router_test.cc"],
70    deps = [
71        ":egress_function",
72        ":static_router",
73        "//pw_assert:check",
74    ],
75)
76
77sphinx_docs_library(
78    name = "docs",
79    srcs = [
80        "Kconfig",
81        "docs.rst",
82    ],
83    prefix = "pw_router/",
84    target_compatible_with = incompatible_with_mcu(),
85)
86