Questions tagged [sockaddr]
10 questions
2
votes
1 answer
Swift getnameinfo unreliable results for IPv6
I have the following extension on sockaddr:
extension sockaddr {
/// Indicates if this is an IPv4 address.
var isIPv4: Bool {
return sa_family == UInt8(AF_INET)
}
/// Indicates if this is an IPv6 address.
var isIPv6: Bool {
return…

Yvo
- 18,681
- 11
- 71
- 90
1
vote
2 answers
Delete and cast. Will delete free the right amount of bytes?
Will delete free the right amount of bytes ?
unique_ptr up = make_unique();
// or unique_ptr up( new sockaddr_in ); ???
/*
Some stuff
sockaddr and sockaddr_in are two different types of…

Markus Fischer
- 29
- 2
1
vote
1 answer
thrift.transport.TTransport.TTransportException: failed to resolve sockaddr for host Pyhive and Python
from pyhive import hive
conn = hive.Connection(host="host", username="hive",auth="NOSASL",port=10000)
cur = conn.cursor()
I wrote this code.I received this error :
thrift.transport.TTransport.TTransportException: failed to resolve sockaddr for…

Oğuz Kırçiçek
- 51
- 1
- 6
1
vote
0 answers
Swift 3 - Migrating error Cannot convert value of type 'sockaddr'
I am trying to convert a OSC library from swift 2 to swift 3. I have only two errors left that I caanot solve. The errors are in the code below.
The errors are given by UnsafePointer
error 1:
Cannot convert value of type 'sockaddr' to expected…

SNos
- 3,430
- 5
- 42
- 92
0
votes
1 answer
sockaddr structures as union
I'm looking for a summary of the socket address structures interpreted as a union to have a complete overview. The only Q&A similar to this I've found is Sockaddr union and getaddrinfo() but it doesn't summarizes the structures.
How does a union of…

Ingo
- 588
- 9
- 21
0
votes
0 answers
Auditd - SOCKADDR - AF_LOCAL - Parsing issues
I set out to parse an auditd log entry containing a SOCKADDR event. I am running into issues with additional data and trying to identify where its coming from and the structure of it.
The current data size I am seeing is 220 hex characters total…

johnnyb
- 1,745
- 3
- 17
- 47
0
votes
1 answer
In struct "sockaddr_in", what do the member prefixes "sin" represent?
In the sockaddr_in struct, each member features a "sin" prefix. What do these prefixes represent?

Izzo
- 4,461
- 13
- 45
- 82
0
votes
3 answers
Casting sockaddr in socket programming violates MISRA C++ 2008 Rule 5-2-7
For socket programming, there are two basic structures to deal with addresses: struct sockaddr_in and sockaddr. According to man, "the only purpose of this structure [sockadrr] is to cast the structure pointer passed in addr in order to avoid…

Javi
- 1
- 4
0
votes
0 answers
why sockaddr_in and sockaddr each is imcompatible?
I try to memcpy ipv4 address in *ai(struct addrinfo)
struct addrinfo *ai;
char *p = (char *)(void *)(ai->ai_addr);
memcpy(p + afd->a_off, "d83adcca", (size_t)afd->a_addrlen); // "d83adcca ipv4 address is hex data - not correct.."
So, i need verify…

hyunsang park
- 11
- 1
- 3
0
votes
0 answers
how to convert from string to sockaddr in c in windows
I am new to C and am trying to read IP addresses from a .csv excel sheet and assign them to a sockaddr. I have the following code but it is not working.
Edit: Debugging shows the value of S_addr after the assignment is 3435973836 for an ip address…

John_D
- 29
- 6