build standalone ipx utilities without ncpfs private headers

This commit is contained in:
Mario Fetka
2026-04-29 19:17:02 +02:00
parent 80f13f2193
commit ea1cadb737
32 changed files with 11006 additions and 666 deletions

View File

@@ -1,22 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <netipx/ipx.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
#include "samples.h"
int main(int argc, char **argv)
{
struct sockaddr_ipx sipx;
int s;
int rc;
char msg[100] = "Hello world!";
int len = sizeof(sipx);
struct sockaddr_ipx sipx;
int s;
int rc;
char msg[100] = "Hello world!";
socklen_t len = sizeof(sipx);
s = socket(AF_IPX, SOCK_DGRAM, AF_IPX);
if (s < 0) {
if (s < 0)
{
perror("IPX: socket: ");
exit(-1);
}
@@ -26,13 +20,13 @@ int main(int argc, char **argv)
sipx.sipx_port = 0;
sipx.sipx_type = 17;
rc = bind(s, (struct sockaddr *)&sipx, sizeof(sipx));
if (rc < 0) {
rc = bind(s, (struct sockaddr *) &sipx, sizeof(sipx));
if (rc < 0)
{
perror("IPX: bind: ");
exit(-1);
}
rc = getsockname(s, (struct sockaddr *)&sipx, &len);
rc = getsockname(s, (struct sockaddr *) &sipx, &len);
sipx.sipx_port = htons(0x5000);
sipx.sipx_node[0] = 0xFF;
sipx.sipx_node[1] = 0xFF;
@@ -42,7 +36,7 @@ int main(int argc, char **argv)
sipx.sipx_node[5] = 0xFF;
rc = sendto(s, msg, strlen(msg), 0, (struct sockaddr *)&sipx,
sizeof(sipx));
sizeof(sipx));
if (rc < 0) {
perror("IPX: send: ");
exit(-1);