Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Refactor base types #195

Merged
merged 11 commits into from
Nov 17, 2021
Merged

Commits on Nov 14, 2021

  1. Configuration menu
    Copy the full SHA
    66c270b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dfb55f5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1cd3e0f View commit details
    Browse the repository at this point in the history
  4. Remove T generic from NetlinkDeserializable and NetlinkSerializable

    `T` always was the same as `Self`.
    Also do a major bump on depending crates.
    stbuehler committed Nov 14, 2021
    Configuration menu
    Copy the full SHA
    94c2632 View commit details
    Browse the repository at this point in the history
  5. Remove constraints from type definitions; remove unneeded constraints…

    … in implementations (apart from Debug)
    
    - where clauses are almost never needed on type definitions unless you
      need them in the `Drop` implementation
    - Debug trait might be useful if (debug) logging gets added
    - Clone/PartialEq/Eq shouldn't be needed ever in the implementations
    stbuehler committed Nov 14, 2021
    Configuration menu
    Copy the full SHA
    71b71ce View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2021

  1. Make codec a Connection type parameter, split audit implementation

    1. get rid of "workaround-audit-bug" "feature"
    
    2. no longer use tokio_util::codec::{Decoder, Encoder}
    
    tokio_util::codec is "designed" for bytestreams (and building "frames"
    of messages on top), but we need to deal with datagrams (which still
    can contain multiples messages, just not one message across multiple
    datagrams).
    
    This make it a little less "combinable", but we actually don't want
    people to reuse these codecs on bytestream (and writing an adapter
    wouldn't be that hard anyway).
    
    Also we can use a fixed error type, making dealing with it a little
    bit easier.
    stbuehler committed Nov 15, 2021
    Configuration menu
    Copy the full SHA
    cac815a View commit details
    Browse the repository at this point in the history
  2. fixup codec

    stbuehler committed Nov 15, 2021
    Configuration menu
    Copy the full SHA
    eda4596 View commit details
    Browse the repository at this point in the history
  3. Fix UB from unsafe uninitialized buffer slices

    Creating &mut [u8] (and &[u8]) for unitialized memory is undefined
    behaviour even when not actually reading the data.
    
    Use bytes::BufMut instead, and advance buffer in recv functions.
    High level functions (without flags param) don't need to return length
    of read, as it was used to advance the buffer - only low-level read
    might return larger length than the buffer (PEEK + TRUNC flags).
    
    This also bumps netlink-sys; the other crates already got bumped.
    stbuehler committed Nov 15, 2021
    Configuration menu
    Copy the full SHA
    7e6cfd7 View commit details
    Browse the repository at this point in the history
  4. Add AsyncSocket trait in netlink-sys

    Preparation to make tokio and smol feature non-conflicting in
    netlink-proto.
    stbuehler committed Nov 15, 2021
    Configuration menu
    Copy the full SHA
    1ea0da5 View commit details
    Browse the repository at this point in the history
  5. Make tokio and smol not conflicting in netlink-proto

    - This adds a new type paramater to connection for the socket being used.
    - can drop tokio/smol selection from netlink-packet-audit
    stbuehler committed Nov 15, 2021
    Configuration menu
    Copy the full SHA
    944307c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    aa89fe6 View commit details
    Browse the repository at this point in the history