Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67508c1f17 | ||
|
|
e85e8f4780 | ||
|
|
175c33b131 | ||
|
|
3bfd273528 | ||
|
|
bfa76009b9 | ||
|
|
c59b44c83e | ||
|
|
88a2ec7a11 | ||
|
|
3b0a510ccf | ||
|
|
2d49df07db | ||
|
|
4d441d89fd | ||
|
|
31fb8f31db |
No files matched your search
@@ -28,7 +28,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-22.04, windows-2022, macos-12]
|
os: [ubuntu-22.04, windows-2022, macos-12, macos-14] # macos-14+ is arm64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
name: Checkout onto ${{ runner.os }}
|
name: Checkout onto ${{ runner.os }}
|
||||||
@@ -359,7 +359,12 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: debug-macos-12
|
name: debug-macos-12
|
||||||
path: neolink_macos
|
path: neolink_macos_intel
|
||||||
|
- name: Download Macos arm64
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: debug-macos-14
|
||||||
|
path: neolink_macos_m1
|
||||||
- name: Download Linux x86_64
|
- name: Download Linux x86_64
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -389,7 +394,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
dirs=(
|
dirs=(
|
||||||
neolink_windows
|
neolink_windows
|
||||||
neolink_macos
|
neolink_macos_intel
|
||||||
|
neolink_macos_m1
|
||||||
neolink_linux_x86_64_ubuntu
|
neolink_linux_x86_64_ubuntu
|
||||||
neolink_linux_x86_64_bookworm
|
neolink_linux_x86_64_bookworm
|
||||||
neolink_linux_armhf
|
neolink_linux_armhf
|
||||||
@@ -406,7 +412,8 @@ jobs:
|
|||||||
name: Neolink ${{steps.toml.outputs.version}}
|
name: Neolink ${{steps.toml.outputs.version}}
|
||||||
files: |
|
files: |
|
||||||
neolink_windows.zip
|
neolink_windows.zip
|
||||||
neolink_macos.zip
|
neolink_macos_intel.zip
|
||||||
|
neolink_macos_m1.zip
|
||||||
neolink_linux_x86_64_ubuntu.zip
|
neolink_linux_x86_64_ubuntu.zip
|
||||||
neolink_linux_x86_64_bookworm.zip
|
neolink_linux_x86_64_bookworm.zip
|
||||||
neolink_linux_armhf.zip
|
neolink_linux_armhf.zip
|
||||||
|
|||||||
+2
-4
@@ -70,8 +70,7 @@ RUN apt-get update && \
|
|||||||
gstreamer1.0-plugins-base \
|
gstreamer1.0-plugins-base \
|
||||||
gstreamer1.0-plugins-good \
|
gstreamer1.0-plugins-good \
|
||||||
gstreamer1.0-plugins-bad \
|
gstreamer1.0-plugins-bad \
|
||||||
gstreamer1.0-libav \
|
gstreamer1.0-libav && \
|
||||||
valgrind && \
|
|
||||||
apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY --from=build \
|
COPY --from=build \
|
||||||
@@ -83,11 +82,10 @@ RUN gst-inspect-1.0; \
|
|||||||
chmod +x "/usr/local/bin/neolink" && \
|
chmod +x "/usr/local/bin/neolink" && \
|
||||||
"/usr/local/bin/neolink" --version && \
|
"/usr/local/bin/neolink" --version && \
|
||||||
mkdir -m 0700 /root/.config/ && \
|
mkdir -m 0700 /root/.config/ && \
|
||||||
mkdir -m 0700 /valgrind/
|
|
||||||
|
|
||||||
|
|
||||||
ENV NEO_LINK_MODE="rtsp" NEO_LINK_PORT=8554
|
ENV NEO_LINK_MODE="rtsp" NEO_LINK_PORT=8554
|
||||||
|
|
||||||
CMD timeout 1800 valgrind --tool=massif --massif-out-file="/valgrind/massif.out.%p" /usr/local/bin/neolink ${NEO_LINK_MODE} --config /etc/neolink.toml
|
CMD /usr/local/bin/neolink ${NEO_LINK_MODE} --config /etc/neolink.toml
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
EXPOSE ${NEO_LINK_PORT}
|
EXPOSE ${NEO_LINK_PORT}
|
||||||
@@ -318,7 +318,7 @@ pub struct Extension {
|
|||||||
pub check_pos: Option<u32>,
|
pub check_pos: Option<u32>,
|
||||||
/// Encrypted binary has this to verify successful decryption
|
/// Encrypted binary has this to verify successful decryption
|
||||||
#[serde(rename = "checkValue", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "checkValue", skip_serializing_if = "Option::is_none")]
|
||||||
pub check_value: Option<u32>,
|
pub check_value: Option<i32>,
|
||||||
/// Used in newer encrypted payload packets
|
/// Used in newer encrypted payload packets
|
||||||
#[serde(rename = "encryptLen", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "encryptLen", skip_serializing_if = "Option::is_none")]
|
||||||
pub encrypt_len: Option<u32>,
|
pub encrypt_len: Option<u32>,
|
||||||
@@ -1737,3 +1737,48 @@ fn test_binary_deser() {
|
|||||||
_ => panic!(),
|
_ => panic!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_enc3_extension() {
|
||||||
|
let _ = env_logger::builder().is_test(true).try_init();
|
||||||
|
let sample = indoc!(
|
||||||
|
r#"<?xml version="1.0\" encoding="UTF-8" ?>
|
||||||
|
<Extension version="1.1">
|
||||||
|
<encryptLen>1024</encryptLen>
|
||||||
|
<binaryData>1</binaryData>
|
||||||
|
<checkPos>0</checkPos>
|
||||||
|
<checkValue>1667510320</checkValue>
|
||||||
|
</Extension>
|
||||||
|
"#
|
||||||
|
);
|
||||||
|
let b = Extension::try_parse(sample.as_bytes()).unwrap();
|
||||||
|
match b {
|
||||||
|
Extension {
|
||||||
|
encrypt_len: Some(1024),
|
||||||
|
binary_data: Some(1),
|
||||||
|
check_pos: Some(0),
|
||||||
|
check_value: Some(1667510320),
|
||||||
|
..
|
||||||
|
} => {}
|
||||||
|
_ => panic!(),
|
||||||
|
}
|
||||||
|
|
||||||
|
let sample = indoc!(
|
||||||
|
r#"
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<Extension version="1.1">
|
||||||
|
<checkPos>0</checkPos>
|
||||||
|
<checkValue>-1211658</checkValue>
|
||||||
|
</Extension>
|
||||||
|
"#
|
||||||
|
);
|
||||||
|
let b = Extension::try_parse(sample.as_bytes()).unwrap();
|
||||||
|
match b {
|
||||||
|
Extension {
|
||||||
|
check_pos: Some(0),
|
||||||
|
check_value: Some(-1211658),
|
||||||
|
..
|
||||||
|
} => {}
|
||||||
|
_ => panic!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -139,6 +139,7 @@ impl Discoverer {
|
|||||||
tokio::task::yield_now().await;
|
tokio::task::yield_now().await;
|
||||||
match reader.next().await {
|
match reader.next().await {
|
||||||
Some(Ok((BcUdp::Discovery(bcudp), addr))) => {
|
Some(Ok((BcUdp::Discovery(bcudp), addr))) => {
|
||||||
|
log::info!("Got discovery {:?} for {}", bcudp, addr);
|
||||||
let tid = bcudp.tid;
|
let tid = bcudp.tid;
|
||||||
let mut needs_removal = false;
|
let mut needs_removal = false;
|
||||||
if let (Some(sender), true) =
|
if let (Some(sender), true) =
|
||||||
@@ -158,9 +159,10 @@ impl Discoverer {
|
|||||||
}
|
}
|
||||||
Some(Ok(bcudp)) => {
|
Some(Ok(bcudp)) => {
|
||||||
// Only discovery packets should be possible atm
|
// Only discovery packets should be possible atm
|
||||||
trace!("Got non Discovery during discovery: {:?}", bcudp);
|
log::info!("Got non Discovery during discovery: {:?}", bcudp);
|
||||||
}
|
}
|
||||||
Some(Err(e)) => {
|
Some(Err(e)) => {
|
||||||
|
log::error!("Error on discovery socket: {:?}", e);
|
||||||
let mut locked_sub = thread_subscriber.write().await;
|
let mut locked_sub = thread_subscriber.write().await;
|
||||||
for (_, sub) in locked_sub.iter() {
|
for (_, sub) in locked_sub.iter() {
|
||||||
let _ = sub.send(Err(e.clone())).await;
|
let _ = sub.send(Err(e.clone())).await;
|
||||||
@@ -360,16 +362,35 @@ impl Discoverer {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
log::info!(
|
||||||
|
"Trying a direct connect to: {:?} with tid: {}",
|
||||||
|
addr,
|
||||||
|
msg.tid
|
||||||
|
);
|
||||||
|
|
||||||
let (camera_address, camera_id) = self
|
let (camera_address, camera_id) = self
|
||||||
.retry_send(msg, addr, |bc, addr| match bc {
|
.retry_send(msg, addr, |bc, addr| match bc {
|
||||||
UdpDiscovery {
|
UdpDiscovery {
|
||||||
tid: _,
|
tid: _,
|
||||||
payload: UdpXml::D2cCr(D2cCr { did, cid, .. }),
|
payload: UdpXml::D2cCr(D2cCr { did, cid, .. }),
|
||||||
} if cid == client_id => Some((addr, did)),
|
} if cid == client_id => {
|
||||||
_ => None,
|
log::info!("Got expected reply");
|
||||||
|
Some((addr, did))
|
||||||
|
}
|
||||||
|
n => {
|
||||||
|
log::info!("Got unexpected reply: {:?}", n);
|
||||||
|
None
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
log::info!(
|
||||||
|
"Direct connect success at {:?} client: {}, device: {}",
|
||||||
|
addr,
|
||||||
|
client_id,
|
||||||
|
camera_id
|
||||||
|
);
|
||||||
|
|
||||||
let result = ConnectResult {
|
let result = ConnectResult {
|
||||||
addr: camera_address,
|
addr: camera_address,
|
||||||
client_id,
|
client_id,
|
||||||
@@ -378,6 +399,7 @@ impl Discoverer {
|
|||||||
};
|
};
|
||||||
self.keep_alive_device(tid, &result).await;
|
self.keep_alive_device(tid, &result).await;
|
||||||
|
|
||||||
|
log::info!("Returning direct connect: {:?}", result);
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user