Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,764 changes: 882 additions & 882 deletions src/SocketCANSharp/LibcNativeMethods.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/SocketCANSharp/Network/AbstractSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public abstract class AbstractSocket : IDisposable
/// <summary>
/// Represents the operating system handle exposed in a safe manner for the socket that the current AbstractSocket object encapsulates.
/// </summary>
public SafeFileDescriptorHandle SafeHandle { get; protected set; }
public SafeHandle SafeHandle { get; protected set; }

/// <summary>
/// Represents the operating system handle for the socket that is encapsulated by this object.
Expand Down
6 changes: 3 additions & 3 deletions src/SocketCANSharp/Network/CanNetworkInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public static IEnumerable<CanNetworkInterface> GetAllInterfaces(bool includeVirt
/// <exception cref="ArgumentException">Socket Handle is closed or invalid.</exception>
/// <exception cref="ArgumentOutOfRangeException">Interface Name is null, empty, or only whitespace characters.</exception>
/// <exception cref="NetworkInformationException">Failed to look up interface by name.</exception>
public static CanNetworkInterface GetInterfaceByName(SafeFileDescriptorHandle socketHandle, string interfaceName)
public static CanNetworkInterface GetInterfaceByName(SafeHandle socketHandle, string interfaceName)
{
if (socketHandle == null)
throw new ArgumentNullException(nameof(socketHandle));
Expand Down Expand Up @@ -491,7 +491,7 @@ public static CanNetworkInterface GetInterfaceByName(SafeFileDescriptorHandle so
/// <exception cref="ArgumentNullException">Socket Handle is null.</exception>
/// <exception cref="ArgumentException">Socket Handle is closed or invalid.</exception>
/// <exception cref="NetworkInformationException">Failed to look up interface by index.</exception>
public static CanNetworkInterface GetInterfaceByIndex(SafeFileDescriptorHandle socketHandle, int interfaceIndex)
public static CanNetworkInterface GetInterfaceByIndex(SafeHandle socketHandle, int interfaceIndex)
{
if (socketHandle == null)
throw new ArgumentNullException(nameof(socketHandle));
Expand All @@ -514,7 +514,7 @@ public static CanNetworkInterface GetInterfaceByIndex(SafeFileDescriptorHandle s
/// <returns>Maximum Transmission Unit of the interface.</returns>
/// <exception cref="NetworkInformationException">Unable to retreive MTU size information for the interface.</exception>
[Obsolete("ReadSupportedMtu method is deprecated, please use MaximumTransmissionUnit property instead.")]
public int ReadSupportedMtu(SafeFileDescriptorHandle socketHandle)
public int ReadSupportedMtu(SafeHandle socketHandle)
{
if (socketHandle == null)
throw new ArgumentNullException(nameof(socketHandle));
Expand Down
9 changes: 5 additions & 4 deletions src/SocketCANSharp/Network/Epoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
using System;
using System.Net.Sockets;
using System.Linq;
using System.Runtime.InteropServices;

namespace SocketCANSharp.Network
{
Expand All @@ -51,7 +52,7 @@ public class Epoll : IDisposable
/// <summary>
/// Represents the operating system handle exposed in a safe manner for the epoll file descriptor that the current Epoll object encapsulates.
/// </summary>
public SafeFileDescriptorHandle SafeHandle { get; }
public SafeHandle SafeHandle { get; }

/// <summary>
/// Represents the operating system handle for the epoll file descriptor that is encapsulated by this object.
Expand All @@ -78,7 +79,7 @@ public Epoll()
/// <exception cref="ObjectDisposedException">Epoll file descriptor is closed.</exception>
/// <exception cref="ArgumentNullException">Socket handle is null.</exception>
/// <exception cref="SocketException">The epoll_ctl call failed.</exception>
public void Add(SafeFileDescriptorHandle socketHandle, EpollEvent eventSettings)
public void Add(SafeHandle socketHandle, EpollEvent eventSettings)
{
if (_disposed)
throw new ObjectDisposedException(GetType().FullName);
Expand All @@ -100,7 +101,7 @@ public void Add(SafeFileDescriptorHandle socketHandle, EpollEvent eventSettings)
/// <exception cref="ObjectDisposedException">Epoll file descriptor is closed.</exception>
/// <exception cref="ArgumentNullException">Socket handle is null.</exception>
/// <exception cref="SocketException">The epoll_ctl call failed.</exception>
public void Modify(SafeFileDescriptorHandle socketHandle, EpollEvent eventSettings)
public void Modify(SafeHandle socketHandle, EpollEvent eventSettings)
{
if (_disposed)
throw new ObjectDisposedException(GetType().FullName);
Expand All @@ -121,7 +122,7 @@ public void Modify(SafeFileDescriptorHandle socketHandle, EpollEvent eventSettin
/// <exception cref="ObjectDisposedException">Epoll file descriptor is closed.</exception>
/// <exception cref="ArgumentNullException">Socket handle is null.</exception>
/// <exception cref="SocketException">The epoll_ctl call failed.</exception>
public void Remove(SafeFileDescriptorHandle socketHandle)
public void Remove(SafeHandle socketHandle)
{
if (_disposed)
throw new ObjectDisposedException(GetType().FullName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ public static class CanGatewayNativeMethods
/// <param name="reqSize">Size of CAN Gateway Request in bytes</param>
/// <returns>The number of bytes written on success, -1 on error</returns>
[DllImport("libc", EntryPoint="write", SetLastError=true)]
public static extern int Write(SafeFileDescriptorHandle socketHandle, CanGatewayRequest req, int reqSize);
public static extern int Write(SafeHandle socketHandle, CanGatewayRequest req, int reqSize);
}
}
8 changes: 4 additions & 4 deletions src/SocketCANSharp/Network/Netlink/NetlinkNativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static class NetlinkNativeMethods
/// <param name="addrSize">Size of address structure</param>
/// <returns>0 on success, -1 on error</returns>
[DllImport("libc", EntryPoint="bind", SetLastError=true)]
public static extern int Bind(SafeFileDescriptorHandle socketHandle, SockAddrNetlink addr, int addrSize);
public static extern int Bind(SafeHandle socketHandle, SockAddrNetlink addr, int addrSize);

/// <summary>
/// Returns the current address to which the socket is bound to.
Expand All @@ -70,7 +70,7 @@ public static class NetlinkNativeMethods
/// <param name="sockAddrLen">The size of the the socket address structure in bytes</param>
/// <returns>0 on success, -1 on error</returns>
[DllImport("libc", EntryPoint="getsockname", SetLastError=true)]
public static extern int GetSockName(SafeFileDescriptorHandle socketHandle, SockAddrNetlink sockAddr, ref int sockAddrLen);
public static extern int GetSockName(SafeHandle socketHandle, SockAddrNetlink sockAddr, ref int sockAddrLen);

/// <summary>
/// Write the Network Interface Information Request to the socket.
Expand All @@ -80,7 +80,7 @@ public static class NetlinkNativeMethods
/// <param name="reqSize">Size of Network Interface Information Request in bytes</param>
/// <returns>The number of bytes written on success, -1 on error</returns>
[DllImport("libc", EntryPoint="write", SetLastError=true)]
public static extern int Write(SafeFileDescriptorHandle socketHandle, NetworkInterfaceInfoRequest req, int reqSize);
public static extern int Write(SafeHandle socketHandle, NetworkInterfaceInfoRequest req, int reqSize);

/// <summary>
/// Write the Network Interface Modifier Request to the socket.
Expand All @@ -90,6 +90,6 @@ public static class NetlinkNativeMethods
/// <param name="reqSize">Size of Network Interface Modifier Request in bytes</param>
/// <returns>The number of bytes written on success, -1 on error</returns>
[DllImport("libc", EntryPoint="write", SetLastError=true)]
public static extern int Write(SafeFileDescriptorHandle socketHandle, NetworkInterfaceModifierRequest req, int reqSize);
public static extern int Write(SafeHandle socketHandle, NetworkInterfaceModifierRequest req, int reqSize);
}
}