[PR #1725] [MERGED] [Rust] Fixes to Net Module #2444

Closed
opened 2026-01-29 17:22:11 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1725
Author: @steel-bucket
Created: 8/9/2025
Status: Merged
Merged: 9/6/2025
Merged by: @prateekmedia

Base: masterHead: migration-net-module-fixes


📝 Commits (10+)

  • 24a6c29 chore(cargo): Add dependencies
  • acfab3c feat: Create new module net in lib_ccxr
  • 67cc60b feat: Add block related functionality in block.rs
  • 54a672c feat: Add target.rs module for sending data blocks related functions
  • f3474d6 feat(modules): Add all necessary modules
  • 3dc6713 feat: Add source.rs module for reading data blocks related functions from source
  • 52d1130 feat: Add C equivalent functions in rust
  • 9ee6f81 feat(module): Add net module in libccxr_export
  • d735f38 chore(cargo): Update Cargo.lock
  • cf317d5 feat: Add C equivalent code in libccxr_exports & use in networking.c

📊 Changes

18 files changed (+2119 additions, -457 deletions)

View changed files

📝 src/lib_ccx/networking.c (+46 -0)
📝 src/rust/Cargo.lock (+285 -203)
📝 src/rust/lib_ccxr/Cargo.lock (+197 -137)
📝 src/rust/lib_ccxr/Cargo.toml (+2 -1)
📝 src/rust/lib_ccxr/src/lib.rs (+1 -0)
src/rust/lib_ccxr/src/net/block.rs (+358 -0)
src/rust/lib_ccxr/src/net/c_functions.rs (+99 -0)
src/rust/lib_ccxr/src/net/mod.rs (+54 -0)
src/rust/lib_ccxr/src/net/source.rs (+415 -0)
src/rust/lib_ccxr/src/net/target.rs (+294 -0)
📝 src/rust/src/decoder/output.rs (+2 -5)
📝 src/rust/src/decoder/service_decoder.rs (+39 -61)
📝 src/rust/src/decoder/tv_screen.rs (+10 -10)
📝 src/rust/src/decoder/window.rs (+1 -1)
📝 src/rust/src/libccxr_exports/bitstream.rs (+10 -10)
📝 src/rust/src/libccxr_exports/mod.rs (+1 -0)
src/rust/src/libccxr_exports/net.rs (+285 -0)
📝 src/rust/src/parser.rs (+20 -29)

📄 Description

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

The net module is not working in either the main branch or the rust port(open currently), this PR aims to solve it by re-writing the UDP implementation and some changes to the parser module..

I've added it so that I could run regressions, so there could be a chance of errors still. But it seems to run fine locally.

To get it to run in your local system

Let's say we are testing on a hauppauge file all_in_with_chris_hayes_20250326_1958.ts
(hauppauge used so that I could showcase where to put the Args)
We would normally do

cd ./linux
./build
./ccextractor --hauppauge  ~/ccxtesting/all_in_with_chris_hayes_20250326_1958.ts 
So, for testing the TCP implementation locally, we have to run this command (Make sure that netcat is installed in linux)
./ccextractor --tcp 1212

In another terminal

 ./ccextractor --hauppauge  ~/ccxtesting/all_in_with_chris_hayes_20250326_1958.ts  --sendto localhost:1212
And for testing the UDP implementation
ccextractor --hauppauge --srt --udp 1235 --stdout

In another terminal

nc -u -w 1 localhost 1235 < ~/ccxtesting/all_in_with_chris_hayes_20250326_1958.ts

These 2 tests work on this branch, and in 0.94(and older releases), but they are non-functional for the main branch as well as the old net PRs.
All Credit for porting the core codebase of net goes to @elbertronnie and @IshanGrover2004


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1725 **Author:** [@steel-bucket](https://github.com/steel-bucket) **Created:** 8/9/2025 **Status:** ✅ Merged **Merged:** 9/6/2025 **Merged by:** [@prateekmedia](https://github.com/prateekmedia) **Base:** `master` ← **Head:** `migration-net-module-fixes` --- ### 📝 Commits (10+) - [`24a6c29`](https://github.com/CCExtractor/ccextractor/commit/24a6c2981ba1dc15d7f249aa884805d296e5fee4) chore(cargo): Add dependencies - [`acfab3c`](https://github.com/CCExtractor/ccextractor/commit/acfab3cef69d0ec654439c91f5d088265c36cc03) feat: Create new module `net` in lib_ccxr - [`67cc60b`](https://github.com/CCExtractor/ccextractor/commit/67cc60b2370751219d0e69c6c17b3a2fe98603fb) feat: Add block related functionality in `block.rs` - [`54a672c`](https://github.com/CCExtractor/ccextractor/commit/54a672c68f19d4cb99b430adb43bfe6a0cd648b3) feat: Add `target.rs` module for sending data blocks related functions - [`f3474d6`](https://github.com/CCExtractor/ccextractor/commit/f3474d6db03e9736c5262f827301331068c00a7c) feat(modules): Add all necessary modules - [`3dc6713`](https://github.com/CCExtractor/ccextractor/commit/3dc6713a4c8b0e3158675fff0de04daefe828731) feat: Add `source.rs` module for reading data blocks related functions from source - [`52d1130`](https://github.com/CCExtractor/ccextractor/commit/52d1130b70d9f32fce34fcb2be54ddf64793ee69) feat: Add C equivalent functions in rust - [`9ee6f81`](https://github.com/CCExtractor/ccextractor/commit/9ee6f8166c47cf23fab67c2f76f1f1ae970edeb2) feat(module): Add `net` module in `libccxr_export` - [`d735f38`](https://github.com/CCExtractor/ccextractor/commit/d735f3810843c34bbed3e9a02df99b8acb7975ce) chore(cargo): Update Cargo.lock - [`cf317d5`](https://github.com/CCExtractor/ccextractor/commit/cf317d5db6564f18233a75314e1ec7200489bfec) feat: Add C equivalent code in `libccxr_exports` & use in `networking.c` ### 📊 Changes **18 files changed** (+2119 additions, -457 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/networking.c` (+46 -0) 📝 `src/rust/Cargo.lock` (+285 -203) 📝 `src/rust/lib_ccxr/Cargo.lock` (+197 -137) 📝 `src/rust/lib_ccxr/Cargo.toml` (+2 -1) 📝 `src/rust/lib_ccxr/src/lib.rs` (+1 -0) ➕ `src/rust/lib_ccxr/src/net/block.rs` (+358 -0) ➕ `src/rust/lib_ccxr/src/net/c_functions.rs` (+99 -0) ➕ `src/rust/lib_ccxr/src/net/mod.rs` (+54 -0) ➕ `src/rust/lib_ccxr/src/net/source.rs` (+415 -0) ➕ `src/rust/lib_ccxr/src/net/target.rs` (+294 -0) 📝 `src/rust/src/decoder/output.rs` (+2 -5) 📝 `src/rust/src/decoder/service_decoder.rs` (+39 -61) 📝 `src/rust/src/decoder/tv_screen.rs` (+10 -10) 📝 `src/rust/src/decoder/window.rs` (+1 -1) 📝 `src/rust/src/libccxr_exports/bitstream.rs` (+10 -10) 📝 `src/rust/src/libccxr_exports/mod.rs` (+1 -0) ➕ `src/rust/src/libccxr_exports/net.rs` (+285 -0) 📝 `src/rust/src/parser.rs` (+20 -29) </details> ### 📄 Description <!-- Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**. --> **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. - [ ] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [ ] I have never used CCExtractor. - [ ] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [x] I am an active contributor to CCExtractor. --- The `net` module is not working in either the main branch or the rust port(open currently), this PR aims to solve it by re-writing the UDP implementation and some changes to the `parser` module.. I've added it so that I could run regressions, so there could be a chance of errors still. But it seems to run fine locally. #### To get it to run in your local system Let's say we are testing on a hauppauge file `all_in_with_chris_hayes_20250326_1958.ts` (hauppauge used so that I could showcase where to put the Args) We would normally do ``` cd ./linux ./build ./ccextractor --hauppauge ~/ccxtesting/all_in_with_chris_hayes_20250326_1958.ts ``` ##### So, for testing the TCP implementation locally, we have to run this command (Make sure that netcat is installed in linux) ``` ./ccextractor --tcp 1212 ``` In another terminal ``` ./ccextractor --hauppauge ~/ccxtesting/all_in_with_chris_hayes_20250326_1958.ts --sendto localhost:1212 ``` ##### And for testing the UDP implementation ``` ccextractor --hauppauge --srt --udp 1235 --stdout ``` In another terminal ``` nc -u -w 1 localhost 1235 < ~/ccxtesting/all_in_with_chris_hayes_20250326_1958.ts ``` These 2 tests work on this branch, and in 0.94(and older releases), but they are non-functional for the main branch as well as the old net PRs. All Credit for porting the core codebase of `net` goes to @elbertronnie and @IshanGrover2004 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:22:11 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2444