Skip to content

Commit aa67ca2

Browse files
committed
Rename ext_south to ext_remote_bound for consistency
The extension type itself is already named `RemoteBound`. This name is important as it is used in zenoh-dissector.
1 parent d182f93 commit aa67ca2

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

commons/zenoh-codec/src/transport/open.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ where
4848
ext_mlink,
4949
ext_lowlatency,
5050
ext_compression,
51-
ext_south,
51+
ext_remote_bound,
5252
} = x;
5353

5454
// Header
@@ -61,7 +61,7 @@ where
6161
+ (ext_mlink.is_some() as u8)
6262
+ (ext_lowlatency.is_some() as u8)
6363
+ (ext_compression.is_some() as u8)
64-
+ (ext_south.is_some() as u8);
64+
+ (ext_remote_bound.is_some() as u8);
6565

6666
#[cfg(feature = "shared-memory")]
6767
{
@@ -108,7 +108,7 @@ where
108108
n_exts -= 1;
109109
self.write(&mut *writer, (compression, n_exts != 0))?;
110110
}
111-
if let Some(south) = ext_south.as_ref() {
111+
if let Some(south) = ext_remote_bound.as_ref() {
112112
n_exts -= 1;
113113
self.write(&mut *writer, (south, n_exts != 0))?;
114114
}
@@ -159,7 +159,7 @@ where
159159
let mut ext_mlink = None;
160160
let mut ext_lowlatency = None;
161161
let mut ext_compression = None;
162-
let mut ext_south = None;
162+
let mut ext_remote_bound = None;
163163

164164
let mut has_ext = imsg::has_flag(self.header, flag::Z);
165165
while has_ext {
@@ -199,7 +199,7 @@ where
199199
}
200200
ext::RemoteBound::ID => {
201201
let (q, ext): (ext::RemoteBound, bool) = eodec.read(&mut *reader)?;
202-
ext_south = Some(q);
202+
ext_remote_bound = Some(q);
203203
has_ext = ext;
204204
}
205205
_ => {
@@ -219,7 +219,7 @@ where
219219
ext_mlink,
220220
ext_lowlatency,
221221
ext_compression,
222-
ext_south,
222+
ext_remote_bound,
223223
})
224224
}
225225
}
@@ -242,7 +242,7 @@ where
242242
ext_mlink,
243243
ext_lowlatency,
244244
ext_compression,
245-
ext_south,
245+
ext_remote_bound,
246246
} = x;
247247

248248
// Header
@@ -257,7 +257,7 @@ where
257257
+ (ext_mlink.is_some() as u8)
258258
+ (ext_lowlatency.is_some() as u8)
259259
+ (ext_compression.is_some() as u8)
260-
+ (ext_south.is_some() as u8);
260+
+ (ext_remote_bound.is_some() as u8);
261261

262262
#[cfg(feature = "shared-memory")]
263263
{
@@ -303,7 +303,7 @@ where
303303
n_exts -= 1;
304304
self.write(&mut *writer, (compression, n_exts != 0))?;
305305
}
306-
if let Some(south) = ext_south.as_ref() {
306+
if let Some(south) = ext_remote_bound.as_ref() {
307307
n_exts -= 1;
308308
self.write(&mut *writer, (south, n_exts != 0))?;
309309
}
@@ -353,7 +353,7 @@ where
353353
let mut ext_mlink = None;
354354
let mut ext_lowlatency = None;
355355
let mut ext_compression = None;
356-
let mut ext_south = None;
356+
let mut ext_remote_bound = None;
357357

358358
let mut has_ext = imsg::has_flag(self.header, flag::Z);
359359
while has_ext {
@@ -393,7 +393,7 @@ where
393393
}
394394
ext::RemoteBound::ID => {
395395
let (q, ext): (ext::RemoteBound, bool) = eodec.read(&mut *reader)?;
396-
ext_south = Some(q);
396+
ext_remote_bound = Some(q);
397397
has_ext = ext;
398398
}
399399
_ => {
@@ -412,7 +412,7 @@ where
412412
ext_mlink,
413413
ext_lowlatency,
414414
ext_compression,
415-
ext_south,
415+
ext_remote_bound,
416416
})
417417
}
418418
}

commons/zenoh-protocol/src/transport/open.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub struct OpenSyn {
9494
pub ext_mlink: Option<ext::MultiLinkSyn>,
9595
pub ext_lowlatency: Option<ext::LowLatency>,
9696
pub ext_compression: Option<ext::Compression>,
97-
pub ext_south: Option<ext::RemoteBound>,
97+
pub ext_remote_bound: Option<ext::RemoteBound>,
9898
}
9999

100100
// Extensions
@@ -160,7 +160,7 @@ impl OpenSyn {
160160
let ext_mlink = rng.gen_bool(0.5).then_some(ZExtZBuf::rand());
161161
let ext_lowlatency = rng.gen_bool(0.5).then_some(ZExtUnit::rand());
162162
let ext_compression = rng.gen_bool(0.5).then_some(ZExtUnit::rand());
163-
let ext_south = rng.gen_bool(0.5).then_some(ZExtZ64::rand());
163+
let ext_remote_bound = rng.gen_bool(0.5).then_some(ZExtZ64::rand());
164164

165165
Self {
166166
lease,
@@ -173,7 +173,7 @@ impl OpenSyn {
173173
ext_mlink,
174174
ext_lowlatency,
175175
ext_compression,
176-
ext_south,
176+
ext_remote_bound,
177177
}
178178
}
179179
}
@@ -197,7 +197,7 @@ pub struct OpenAck {
197197
pub ext_mlink: Option<ext::MultiLinkAck>,
198198
pub ext_lowlatency: Option<ext::LowLatency>,
199199
pub ext_compression: Option<ext::Compression>,
200-
pub ext_south: Option<ext::RemoteBound>,
200+
pub ext_remote_bound: Option<ext::RemoteBound>,
201201
}
202202

203203
impl OpenAck {
@@ -224,7 +224,7 @@ impl OpenAck {
224224
let ext_mlink = rng.gen_bool(0.5).then_some(ZExtUnit::rand());
225225
let ext_lowlatency = rng.gen_bool(0.5).then_some(ZExtUnit::rand());
226226
let ext_compression = rng.gen_bool(0.5).then_some(ZExtUnit::rand());
227-
let ext_south = rng.gen_bool(0.5).then_some(ZExtZ64::rand());
227+
let ext_remote_bound = rng.gen_bool(0.5).then_some(ZExtZ64::rand());
228228

229229
Self {
230230
lease,
@@ -236,7 +236,7 @@ impl OpenAck {
236236
ext_mlink,
237237
ext_lowlatency,
238238
ext_compression,
239-
ext_south,
239+
ext_remote_bound,
240240
}
241241
}
242242
}

io/zenoh-transport/src/unicast/establishment/accept.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ struct AcceptLink<'a> {
149149
#[cfg(feature = "transport_compression")]
150150
ext_compression: ext::compression::CompressionFsm<'a>,
151151
ext_patch: ext::patch::PatchFsm<'a>,
152-
ext_south: Option<RemoteBoundCallback>,
152+
ext_remote_bound: Option<RemoteBoundCallback>,
153153
ext_region_name: ext::region_name::RegionNameFsm,
154154
}
155155

@@ -596,7 +596,7 @@ impl<'a, 'b: 'a> AcceptFsm for &'a mut AcceptLink<'b> {
596596
let output = RecvOpenSynOut {
597597
other_zid: cookie.zid,
598598
other_whatami: cookie.whatami,
599-
other_bound: match open_syn.ext_south {
599+
other_bound: match open_syn.ext_remote_bound {
600600
Some(ext) => Some(
601601
Bound::try_from(ext.value as u8)
602602
.map_err(|e| (e.into(), Some(close::reason::GENERIC)))?,
@@ -681,7 +681,7 @@ impl<'a, 'b: 'a> AcceptFsm for &'a mut AcceptLink<'b> {
681681
.map_err(|e| (e, Some(close::reason::GENERIC)))?;
682682

683683
// Extension South
684-
let ext_south = if let Some(callback) = self.ext_south.as_ref() {
684+
let ext_remote_bound = if let Some(callback) = self.ext_remote_bound.as_ref() {
685685
let p = TransportPeer {
686686
zid: input.other_zid,
687687
whatami: input.other_whatami,
@@ -716,7 +716,7 @@ impl<'a, 'b: 'a> AcceptFsm for &'a mut AcceptLink<'b> {
716716
ext_mlink,
717717
ext_lowlatency,
718718
ext_compression,
719-
ext_south,
719+
ext_remote_bound,
720720
};
721721

722722
// Do not send the OpenAck right now since we might still incur in MAX_LINKS error
@@ -767,7 +767,7 @@ pub(crate) async fn accept_link(link: LinkUnicast, manager: &TransportManager) -
767767
#[cfg(feature = "transport_compression")]
768768
ext_compression: ext::compression::CompressionFsm::new(),
769769
ext_patch: ext::patch::PatchFsm::new(),
770-
ext_south: manager.config.bound_callback.clone(),
770+
ext_remote_bound: manager.config.bound_callback.clone(),
771771
ext_region_name: ext::region_name::RegionNameFsm::new(manager.config.region_name.clone()),
772772
};
773773

io/zenoh-transport/src/unicast/establishment/open.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct OpenLink<'a> {
131131
ext_patch: ext::patch::PatchFsm<'a>,
132132
ext_region_name: ext::region_name::RegionNameFsm,
133133
// TODO(regions): move this into `ext::region::RegionFsm` (?)
134-
ext_south: Option<RemoteBoundCallback>,
134+
ext_remote_bound: Option<RemoteBoundCallback>,
135135
}
136136

137137
#[async_trait]
@@ -466,7 +466,7 @@ impl<'a, 'b: 'a> OpenFsm for &'a mut OpenLink<'b> {
466466
.map_err(|e| (e, Some(close::reason::GENERIC)))?;
467467

468468
// Extension South
469-
let ext_south = if let Some(callback) = self.ext_south.as_ref() {
469+
let ext_remote_bound = if let Some(callback) = self.ext_remote_bound.as_ref() {
470470
let p = TransportPeer {
471471
zid: input.other_zid,
472472
whatami: input.other_whatami,
@@ -502,7 +502,7 @@ impl<'a, 'b: 'a> OpenFsm for &'a mut OpenLink<'b> {
502502
ext_mlink,
503503
ext_lowlatency,
504504
ext_compression,
505-
ext_south,
505+
ext_remote_bound,
506506
}
507507
.into();
508508

@@ -603,7 +603,7 @@ impl<'a, 'b: 'a> OpenFsm for &'a mut OpenLink<'b> {
603603
.map_err(|e| (e, Some(close::reason::GENERIC)))?;
604604

605605
let output = RecvOpenAckOut {
606-
other_bound: match open_ack.ext_south {
606+
other_bound: match open_ack.ext_remote_bound {
607607
Some(ext) => Some(
608608
Bound::try_from(ext.value as u8)
609609
.map_err(|e| (e.into(), Some(close::reason::GENERIC)))?,
@@ -652,7 +652,7 @@ pub(crate) async fn open_link(
652652
#[cfg(feature = "transport_compression")]
653653
ext_compression: ext::compression::CompressionFsm::new(),
654654
ext_patch: ext::patch::PatchFsm::new(),
655-
ext_south: manager.config.bound_callback.clone(),
655+
ext_remote_bound: manager.config.bound_callback.clone(),
656656
ext_region_name: ext::region_name::RegionNameFsm::new(manager.config.region_name.clone()),
657657
};
658658

0 commit comments

Comments
 (0)