Item Proposal Template

Launch Ppt Format

product launch presentation support ppt gslides keynote format figma saas product launch powerpoint ppt template bundles ppt example ppt on product launch at alex wright blog ppt on product launch at alex wright blog product launch ppt template new product launch timeline powerpoint ppt template bundles ppt product launch plan template ppt cover slide new product launch ppt template slidemodel slide for introductory presentation product launch ppt template product launch marketing plan schedule example of ppt presentation table of content template 3 ppt powerpoint presentation file format ideas latest product launch ppt powerpoint presentation gallery files cpb product launch business general ppt template google slide and editable product comparison ppt template slidekit marketing plan new product launch ppt powerpoint presentation complete detail product launch ppt template free koleksi nomer 18 explore now product launch powerpoint and google slides new brand launch colored icon in powerpoint pptx png and editable eps get now product launch marketing plan ppt and google slides brand launch powerpoint and google slides template ppt slides go live rocket launch powerpoint template rocket slides go live rocket launch powerpoint template rocket slides pre launch campaign colored icon in powerpoint pptx png and editable new product launch presentation free template download post launch support monotone icon in powerpoint pptx png and editable product launch marketing powerpoint template nulivo market product launch marketing powerpoint template nulivo market product launch marketing powerpoint template nulivo market launch marketing plan west hollywood marketing visitors bureau and product launch powerpoint at justin pope blog calendar with launch date colored icon in powerpoint pptx png and business post launch evaluation monotone icon in powerpoint pptx png product launch presentation template funnel powerpoint templates and google slides slidekit free product presentation templates to customize online cool background template for powerpoint and google slides slidekit staggered process template for powerpoint and google slides slidekit job interview powerpoint template presentation slides free brand presentation templates smartsheet 4 steps picture timeline powerpoint template slidekit merger and acquisition presentation template for powerpoint slidekit

:
My Hobby Writing
Use std's endian conversion function
1 parent Science Writing In A Newspaper commit f90fc01

Product launch presentation support ppt gslides keynote format figma 1 file changed Artists Business Cards

Lines changed: 13 additions & 22 deletions

Instagram Your Story Launch Ppt Format

src/lib.rs

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ use std::time::{Duration, SystemTime};
4343

4444
const NLMSG_HDRLEN: usize = nfq_align(std::mem::size_of::<nlmsghdr>());
4545

46-
fn be16_to_cpu(x: u16) -> u16 {
47-
u16::from_ne_bytes(x.to_be_bytes())
48-
}
49-
fn be32_to_cpu(x: u32) -> u32 {
50-
u32::from_ne_bytes(x.to_be_bytes())
51-
}
52-
fn be64_to_cpu(x: u64) -> u64 {
53-
u64::from_ne_bytes(x.to_be_bytes())
54-
}
55-
5646
/// Netlink messages pad to a 4 byte alignment between sections.
5747
const fn nfq_align(len: usize) -> usize {
5848
(len + 3) & !3
@@ -81,7 +71,7 @@ unsafe fn nfq_hdr_put(nlmsg: &mut Nlmsg, typ: u16, queue_num: u16, ack: bool) {
8171
let nfg: *mut nfgenmsg = nlmsg.extra_header();
8272
(*nfg).nfgen_family = AF_UNSPEC as u8;
8373
(*nfg).version = NFNETLINK_V0 as u8;
84-
(*nfg).res_id = be16_to_cpu(queue_num);
74+
(*nfg).res_id = queue_num.to_be();
8575
}
8676

8777
/// Helper functions for parsing `nlattr`. We do this ourselves instead of using libmnl to avoid
@@ -103,7 +93,7 @@ mod nla {
10393
/// Get u32 from payload and convert it to native endian
10494
#[inline]
10595
pub unsafe fn get_u32(attr: *const libc::nlattr) -> u32 {
106-
super::be32_to_cpu(*get_payload(attr))
96+
u32::from_be(*get_payload(attr))
10797
}
10898
}
10999

@@ -183,7 +173,7 @@ impl<'a> Nlmsg<'a> {
183173
/// Put an u32 attribute, convert to big endian
184174
fn put_u32(&mut self, typ: u16, data: u32) {
185175
let ptr = self.put_raw(typ, 4);
186-
unsafe { *ptr = be32_to_cpu(data) };
176+
unsafe { *ptr = data.to_be() };
187177
}
188178

189179
fn as_hdr(&mut self) -> *mut nlmsghdr {
@@ -336,8 +326,8 @@ impl Message {
336326
return None;
337327
}
338328
unsafe {
339-
let duration = Duration::from_secs(be64_to_cpu((*self.timestamp).sec))
340-
+ Duration::from_micros(be64_to_cpu((*self.timestamp).usec));
329+
let duration = Duration::from_secs(u64::from_be((*self.timestamp).sec))
330+
+ Duration::from_micros(u64::from_be((*self.timestamp).usec));
341331
Some(SystemTime::UNIX_EPOCH + duration)
342332
}
343333
}
@@ -349,21 +339,21 @@ impl Message {
349339
return None;
350340
}
351341
unsafe {
352-
let len = be16_to_cpu((*self.hwaddr).hw_addrlen) as usize;
342+
let len = u16::from_be((*self.hwaddr).hw_addrlen) as usize;
353343
Some(&(*self.hwaddr).hw_addr[..len])
354344
}
355345
}
356346

357347
/// Get the packet ID that netfilter uses to track the packet.
358348
#[inline]
359349
pub fn get_packet_id(&self) -> u32 {
360-
unsafe { be32_to_cpu((*self.hdr).packet_id) }
350+
u32::from_be(unsafe { (*self.hdr).packet_id })
361351
}
362352

363353
/// Get the link layer protocol number, e.g. the EtherType field on Ethernet links.
364354
#[inline]
365355
pub fn get_hw_protocol(&self) -> u16 {
366-
be16_to_cpu(unsafe { (*self.hdr).hw_protocol })
356+
u16::from_be(unsafe { (*self.hdr).hw_protocol })
367357
}
368358

369359
/// Get the netfilter hook number that handles this packet.
@@ -550,7 +540,7 @@ unsafe fn parse_msg(nlh: *const nlmsghdr, queue: &mut Queue) {
550540

551541
let mut message = Message {
552542
buffer: Arc::clone(&queue.buffer),
553-
id: be16_to_cpu((*nfgenmsg).res_id),
543+
id: u16::from_be((*nfgenmsg).res_id),
554544
hdr: std::ptr::null(),
555545
nfmark: 0,
556546
nfmark_dirty: false,
@@ -790,7 +780,7 @@ impl Queue {
790780
let mut nlmsg = Nlmsg::new(&mut buf);
791781
nfq_hdr_put(&mut nlmsg, NFQNL_MSG_CONFIG as u16, queue_num, true);
792782
let params = nfqnl_msg_config_params {
793-
copy_range: be32_to_cpu(range as u32),
783+
copy_range: (range as u32).to_be(),
794784
copy_mode: if range == 0 {
795785
NFQNL_COPY_META
796786
} else {
@@ -944,13 +934,14 @@ impl Queue {
944934
let mut nlmsg = Nlmsg::new(&mut buffer[..]);
945935
nfq_hdr_put(&mut nlmsg, NFQNL_MSG_VERDICT as u16, msg.id, false);
946936
let vh = nfqnl_msg_verdict_hdr {
947-
verdict: be32_to_cpu(match msg.verdict {
937+
verdict: (match msg.verdict {
948938
Verdict::Drop => 0,
949939
Verdict::Accept => 1,
950940
Verdict::Queue(num) => (num as u32) << 16 | 3,
951941
Verdict::Repeat => 4,
952942
Verdict::Stop => 5,
953-
}),
943+
})
944+
.to_be(),
954945
id: (*msg.hdr).packet_id,
955946
};
956947
nlmsg.put_slice(NFQA_VERDICT_HDR as u16, std::slice::from_ref(&vh));

Frosted Plastic Business Cards Launch Ppt Format

Comments
 (0)