Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- **Finite S2b Create Session Response F-TEID receive policy —
`opc-proto-gtpv2c`:**
`S2bCreateSessionResponseReceivePolicy` and the one-shot
`decode_create_session_response_summary_with_receive_policy` let callers
independently add standardized S5/S8 PGW control type 7 and user-plane type
5 to the strict default S2b role sets `{32}` and `{33}`. The copied finite
policy binds ProcedureAware first-occurrence validation to typed projection;
existing decode/projection APIs and canonical builders remain strict, and
errors and Debug output remain value-free.
- **Durable grouped XFRM object roster transaction — `opc-ipsec-xfrm`:**
`LinuxXfrmBackend::bind_current_network_namespace_with_object_roster_recovery`
and the opt-in migration constructor
Expand Down
14 changes: 12 additions & 2 deletions crates/opc-proto-gtpv2c/CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ failures and must cover at least these rules:
1/interface type 32, and Bearer Context for accepted responses (Cause 16/17).
The control endpoint requires a non-zero TEID and at least one address;
instance-0 Sender F-TEID is unexpected on this S2b response profile and is
discarded. Rejected responses may expose Cause-only summaries.
discarded. Rejected responses may expose Cause-only summaries. The explicit
one-shot receive policy may independently add only S5/S8 PGW control type 7
and PGW user-plane type 5 to the strict role sets `{32}` and `{33}`. The
policy is copied for one decode and binds validation and typed projection to
the same first retained role occurrence. It cannot admit arbitrary interface
values or affect another profile; no-policy APIs and canonical builders stay
strict S2b and emit only control type 32 and user-plane type 33.
- S2b Modify Bearer Request is the UE-initiated IPsec tunnel-update profile.
It requires a non-zero header TEID but no mandatory IE. WLAN Location
Information (TWAN Identifier instance 0) and WLAN Location Timestamp (TWAN
Expand Down Expand Up @@ -245,7 +251,11 @@ failures and must cover at least these rules:
grouped scope is retained, later occurrences are ignored, and bounded
`S2bReceiveDiagnostics` records only type, instance, scope/depth, first
offset, and a saturated duplicate count. A malformed or semantically invalid
first value remains an error and cannot be repaired by a later value.
first value remains an error and cannot be repaired by a later value. For
Create Session Response nested F-TEIDs, this rule applies per `(type,
instance)` singleton key: distinct table-defined instances remain eligible
for their distinct roles, while a later duplicate at the same instance can
never repair the retained first occurrence.
- ProcedureAware receive classifies every crate-known typed/control IE key
against one message grammar keyed by procedure, direction, and exact
enclosing Bearer Context instance before decoding its value. Unexpected
Expand Down
34 changes: 34 additions & 0 deletions crates/opc-proto-gtpv2c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,40 @@ let response = S2bCreateSessionAcceptedResponse {
};
```

Create Session Response receive decoding remains strict by default: the PGW
control role accepts only interface type 32 and the PGW user-plane role only
type 33. A caller that has already made its own interworking decision can use
the one-shot `decode_create_session_response_summary_with_receive_policy`
helper with `S2bCreateSessionResponseReceivePolicy` to independently add the
standardized S5/S8 control type 7, user-plane type 5, or both. The policy has no
arbitrary interface-type constructor, is copied for one decode, and is applied
to the same first retained singleton used by the returned typed summary. It
does not affect `S2bMessage::decode`, the no-policy summary helpers, any other
GTPv2-C procedure, or canonical builders; those remain strict S2b.

```rust
use opc_proto_gtpv2c::{
decode_create_session_response_summary_with_receive_policy,
S2bCreateSessionResponseReceivePolicy,
};
use opc_protocol::{DecodeContext, ValidationLevel};

# let response_bytes: &[u8] = &[];
let receive_policy = S2bCreateSessionResponseReceivePolicy::STRICT
.allow_s5_s8_pgw_control()
.allow_s5_s8_pgw_user_plane();
let receive_context = DecodeContext {
validation_level: ValidationLevel::ProcedureAware,
..DecodeContext::default()
};
let summary = decode_create_session_response_summary_with_receive_policy(
response_bytes,
receive_context,
receive_policy,
);
# let _ = summary;
```

The former loose Update Bearer shell with a single `bearer_context` has been
replaced by the strict dedicated-bearer API. Construct
`S2bUpdateBearerRequest` with mandatory `apn_ambr` and one to fifteen
Expand Down
42 changes: 22 additions & 20 deletions crates/opc-proto-gtpv2c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,32 +163,34 @@ pub use pco::{
};
#[allow(deprecated)]
pub use s2b::{
decode_create_session_response_summary, decode_echo_message_evidence, is_s2b_message_type,
s2b_create_session_accepted_response, s2b_create_session_rejected_response,
s2b_create_session_request, s2b_delete_session_request, s2b_delete_session_response,
s2b_echo_request, s2b_echo_response, s2b_modify_bearer_request, s2b_modify_bearer_response,
s2b_ue_ipsec_tunnel_update_request, CreateSessionAcceptedResponseSummary,
CreateSessionRejectedResponseSummary, CreateSessionResponseSummary,
CreateSessionResponseSummaryError, EchoMessageEvidence, EchoMessageEvidenceError,
Gtpv2cClientResponseEvidence, Gtpv2cClientTransaction, Gtpv2cClientTransactionDecision,
Gtpv2cClientTransactionKey, Gtpv2cClientTransactionMismatch, Gtpv2cClientTransactionPlan,
Gtpv2cClientTransactionPlanError, Gtpv2cClientTransactionPolicy,
decode_create_session_response_summary,
decode_create_session_response_summary_with_receive_policy, decode_echo_message_evidence,
is_s2b_message_type, s2b_create_session_accepted_response,
s2b_create_session_rejected_response, s2b_create_session_request, s2b_delete_session_request,
s2b_delete_session_response, s2b_echo_request, s2b_echo_response, s2b_modify_bearer_request,
s2b_modify_bearer_response, s2b_ue_ipsec_tunnel_update_request,
CreateSessionAcceptedResponseSummary, CreateSessionRejectedResponseSummary,
CreateSessionResponseSummary, CreateSessionResponseSummaryError, EchoMessageEvidence,
EchoMessageEvidenceError, Gtpv2cClientResponseEvidence, Gtpv2cClientTransaction,
Gtpv2cClientTransactionDecision, Gtpv2cClientTransactionKey, Gtpv2cClientTransactionMismatch,
Gtpv2cClientTransactionPlan, Gtpv2cClientTransactionPlanError, Gtpv2cClientTransactionPolicy,
Gtpv2cClientTransactionProjection, Gtpv2cClientTransactionSnapshot,
Gtpv2cClientTransactionState, Gtpv2cEchoPeer, Gtpv2cEchoPeerBlocker, Gtpv2cEchoPeerError,
Gtpv2cEchoPeerEvent, Gtpv2cEchoPeerPolicy, Gtpv2cEchoPeerProjection, Gtpv2cEchoPeerReadiness,
Gtpv2cEchoPeerSnapshot, Gtpv2cEchoPeerState, Gtpv2cEchoPeerTransition, Gtpv2cPeerToken,
MessageDirection, Procedure, S2bAaaProvidedMsisdn, S2bCreateSessionAcceptedResponse,
S2bCreateSessionContext, S2bCreateSessionContextSummary, S2bCreateSessionIdentity,
S2bCreateSessionRejectedResponse, S2bCreateSessionRequest, S2bDecodedMessage,
S2bDeleteSessionContext, S2bDeleteSessionContextSummary, S2bDeleteSessionRequest,
S2bDeleteSessionResponse, S2bMessage, S2bModifyBearerRequest, S2bModifyBearerResponse,
S2bProcedureMessage, S2bProfileBuildError, S2bProfileBuildResult, S2bReceiveDiagnostics,
S2bSessionContextProjectionError, S2bUeEndpoint, S2bUeIpsecTunnelUpdateEndpoint,
S2bUeIpsecTunnelUpdateProjectionError, S2bUeIpsecTunnelUpdateRequest,
S2bUeIpsecTunnelUpdateRequestSummary, S2bUeIpsecTunnelUpdateResponseSummary, S2bUeNatTraversal,
CREATE_BEARER_REQUEST, CREATE_BEARER_RESPONSE, CREATE_SESSION_REQUEST, CREATE_SESSION_RESPONSE,
DELETE_BEARER_REQUEST, DELETE_BEARER_RESPONSE, DELETE_SESSION_REQUEST, DELETE_SESSION_RESPONSE,
ECHO_REQUEST, ECHO_RESPONSE, INTERFACE_TYPE_S2B_EPDG_GTP_C, INTERFACE_TYPE_S2B_PGW_GTP_C,
S2bCreateSessionRejectedResponse, S2bCreateSessionRequest,
S2bCreateSessionResponseReceivePolicy, S2bDecodedMessage, S2bDeleteSessionContext,
S2bDeleteSessionContextSummary, S2bDeleteSessionRequest, S2bDeleteSessionResponse, S2bMessage,
S2bModifyBearerRequest, S2bModifyBearerResponse, S2bProcedureMessage, S2bProfileBuildError,
S2bProfileBuildResult, S2bReceiveDiagnostics, S2bSessionContextProjectionError, S2bUeEndpoint,
S2bUeIpsecTunnelUpdateEndpoint, S2bUeIpsecTunnelUpdateProjectionError,
S2bUeIpsecTunnelUpdateRequest, S2bUeIpsecTunnelUpdateRequestSummary,
S2bUeIpsecTunnelUpdateResponseSummary, S2bUeNatTraversal, CREATE_BEARER_REQUEST,
CREATE_BEARER_RESPONSE, CREATE_SESSION_REQUEST, CREATE_SESSION_RESPONSE, DELETE_BEARER_REQUEST,
DELETE_BEARER_RESPONSE, DELETE_SESSION_REQUEST, DELETE_SESSION_RESPONSE, ECHO_REQUEST,
ECHO_RESPONSE, INTERFACE_TYPE_S2B_EPDG_GTP_C, INTERFACE_TYPE_S2B_PGW_GTP_C,
INTERFACE_TYPE_S2B_U_EPDG_GTP_U, INTERFACE_TYPE_S2B_U_PGW_GTP_U, MODIFY_BEARER_REQUEST,
MODIFY_BEARER_RESPONSE, UPDATE_BEARER_REQUEST, UPDATE_BEARER_RESPONSE,
};
Expand Down
Loading