DEENESPTFRRUARHIKOZHNL

命名空间 ara::fw

用户指南人工智能生成

提供用于状态相关 Firewall 控制的接口以及标准化错误码。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 6e0fe6eab1d5 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

提供用于状态相关 Firewall 控制的接口以及标准化错误码。

命名空间 ara::fw 为 AUTOSAR Adaptive Platform 中的 Firewall 控制及其标准化错误处理提供类型和接口。该模块通过 FirewallStateSwitchInterface 定义了 Firewall 状态接口,并通过线程安全函数 MakeErrorCode 基于错误域 FwErrorDomain [AP_SWS_Fw_83003] 生成类型化错误对象。出现的问题通过枚举 FwErrc 表示,该枚举指示不可用服务或无效的状态相关配置等 [AP_SWS_Fw_83001]。所有用于生成错误的核心函数都是线程安全的,并声明为 noexcept。

上下文

命名空间 ara::fw 汇集了 Release R25-11 中 AUTOSAR Adaptive Platform 的 Firewall 功能的编程接口和类型。该模块的主要角色是提供用于过滤和保护车载网络通信的机制。命名空间的核心组成部分包括接口 FirewallStateSwitchInterface 以及由 FwErrorDomain、FwException 和关联错误码组成的标准化错误处理组件。该架构无缝融入 ara::core 的平台错误概念中。诸如状态管理平台服务或应用程序等外部交互伙伴使用该命名空间来控制安全相关的 Firewall 状态或解析发生的执行错误。解读:类 FirewallStateSwitchInterface 可能用作根据上级系统状态激活和切换规则集的主接口。 问题 Q-d4ba0994e0147cf1 (未决)

Anwendung Anwendung FirewallStateSwitchInterface FirewallStateSwitchInterface Anwendung->FirewallStateSwitchInterface Zustandswechsel anfordern FwErrorDomain FwErrorDomain Anwendung->FwErrorDomain 检查错误码 FirewallStateSwitchInterface->FwErrorDomain Fehlercode erzeugen

上下文图:应用程序、FirewallStateSwitchInterface 和 FwErrorDomain 在错误解析中的交互。来源:[AP_SWS_Fw_83001]、[AP_SWS_Fw_83002]、[AP_SWS_Fw_83003]。

使用路径

命名空间 ara::fw 中的典型使用路径包括在执行 Firewall 功能时发起状态更改以及生成、传递和评估错误状态。如果 FirewallStateSwitchInterface 上下文中的操作失败或无法满足状态请求,模块将访问特定错误域,以便为调用方提供精确的诊断结果。要实例化此类错误,将调用函数 MakeErrorCode [AP_SWS_Fw_83003]。该函数通过接收来自 FwErrc 的错误值 [AP_SWS_Fw_83001] 以及 ara::core::ErrorDomain::SupportDataType 类型的可选供应商特定附加数据 [AP_SWS_Fw_83003] 来创建 ara::core::ErrorCode。由于 MakeErrorCode 被声明为 constexpr 和 noexcept,因此可以以资源节约且确定性的方式创建错误码。

在调用方,返回的错误通常由结果对象(如 ara::core::Result)接收。自由函数 GetFwErrorDomain [AP_SWS_Fw_83002] 用于通过程序控制验证错误来源,该函数返回对错误域单例 FwErrorDomain 的常量引用。调用方借此可以比对发生的错误是否确实源自 Firewall 模块,并获取其文本描述。解读:在使用 C++ 异常的系统架构中,类 FwException 的作用可能在于以可捕获的方式封装 ara::core::ErrorCode,并将其同步转发给上层错误处理例程。 问题 (未决)

错误场景

针对错误情况,命名空间 ara::fw 中的枚举 FwErrc 为错误域 FwErrorDomain 定义了特定的错误原因 [AP_SWS_Fw_83001]。头文件 ara/fw/fw_error_domain.h 声明了以下标准化错误状态:

  • kServiceNotAvailable(值 1):表示寻址的 Firewall 服务在运行时不可达或当前未就绪 [AP_SWS_Fw_83001]。可能的原因包括后台组件尚未初始化或临时连接中断。后续调用的前提条件未满足,因此调用方必须查询服务状态或在稍后重试请求。
  • kInvalidStateDependentFirewall(值 2):当请求的状态相关 Firewall 配置无效或请求了无效的状态转换时发生 [AP_SWS_Fw_83001]。成功进行切换操作的前提条件是目标 Firewall 支持所需状态且系统处于允许的基本状态。发生此错误后,Firewall 将保持在先前的保护模式不变。

这两个错误值均基于基类型 ara::core::ErrorDomain::CodeType [AP_SWS_Fw_83001]。函数 GetFwErrorDomain [AP_SWS_Fw_83002] 和 MakeErrorCode [AP_SWS_Fw_83003] 明确声明为线程安全(thread-safe)和 noexcept,从而即使在高度并发或时间关键的上下文中也能确保安全的错误处理。

本指南基于 AUTOSAR Adaptive Platform R25-11 关于 fw 模块的规范。

Diese Seite wurde vollständig KI-generiert auf Basis von SWS Firewall (R25-11) — kein offizieller AUTOSAR-Text und keine automatisch extrahierte API-Seite wie die übrigen Module. Als Interpretation gekennzeichnete Aussagen sind Schlussfolgerungen aus den Quellen.

主题图

详细视图

请在大纲中选择一个条目。

类

函数

Returns a reference to the FwErrorDomain object.

constexpr const ara::core::ErrorDomain &GetFwErrorDomain() noexcept;

Creates an ErrorCode instance.

constexpr ara::core::ErrorCode MakeErrorCode(ara::fw::FwErrc code, ara::core::ErrorDomain::SupportDataType data) noexcept;

类型与常量

FwErrc 枚举

Defines the error codes for FwErrorDomain.

enum class FwErrc : ara::core::ErrorDomain::CodeType {...};

枚举

枚举 FwErrc [AP_SWS_Fw_83001]

enum class FwErrc : ara::core::ErrorDomain::CodeType {...};

Defines the error codes for FwErrorDomain.

Header-Datei#include "ara/fw/fw_error_domain.h"
Scopenamespace ara::fw
WertekServiceNotAvailable=1; kInvalidStateDependentFirewall=2

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_Fw_83001
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_Fw_83001@rel:R25-11#ae2df8e4
Content hash
ae2df8e4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Firewall.pdf#nameddest=AP_SWS_Fw_83001
Status: valid/unmigrated Version: rel:R25-11#633624be Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_Fw_83001@rel:R25-11#633624be
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

自由函数文档

函数 GetFwErrorDomain [AP_SWS_Fw_83002]

constexpr const ara::core::ErrorDomain &GetFwErrorDomain() noexcept;

Returns a reference to the FwErrorDomain object.

Header-Datei#include "ara/fw/fw_error_domain.h"
Scopenamespace ara::fw
Thread-Sicherheitthread-safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_Fw_83002
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_Fw_83002@rel:R25-11#34446d91
Content hash
34446d91
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Firewall.pdf#nameddest=AP_SWS_Fw_83002
Status: valid/unmigrated Version: rel:R25-11#f9ce9708 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_Fw_83002@rel:R25-11#f9ce9708
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 MakeErrorCode [AP_SWS_Fw_83003]

constexpr ara::core::ErrorCode MakeErrorCode(ara::fw::FwErrc code, ara::core::ErrorDomain::SupportDataType data) noexcept;

Creates an ErrorCode instance.

Header-Datei#include "ara/fw/fw_error_domain.h"
Scopenamespace ara::fw
Thread-Sicherheitthread-safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/AP_SWS_Fw_83003
Status
valid/unmigrated
Version
AUTOSAR/AP/record/AP_SWS_Fw_83003@rel:R25-11#d60d857f
Content hash
d60d857f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Firewall.pdf#nameddest=AP_SWS_Fw_83003
Status: valid/unmigrated Version: rel:R25-11#1f918c6d Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/AP_SWS_Fw_83003@rel:R25-11#1f918c6d
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill