tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / bsdsocket / api / miami_api.c
blobe3930cf47cd0c71067cdad2f7318475250642bcd
1 //#include <clib/debug_protos.h>
2 #include <dos/dos.h>
3 //#include <emul/emulregs.h>
4 #include <exec/libraries.h>
5 #include <exec/lists.h>
6 #include <exec/resident.h>
7 #include <exec/semaphores.h>
8 #include <sys/types.h>
9 #include <libraries/miami.h>
10 #include <proto/exec.h>
11 #include <proto/utility.h>
13 #define _GRP_H_
14 #define _PWD_H_
15 #define USE_INLINE_STDARG
16 //#include <proto/usergroup.h>
18 #include <conf.h>
19 #include <sys/malloc.h>
20 #include <sys/socket.h>
21 #include <kern/amiga_log.h>
22 #include <net/route.h>
23 #include <net/if.h>
24 #include <net/if_protos.h>
25 #include <net/pfil.h>
26 #include <errno.h>
27 #include <netdb.h>
28 #include <string.h>
29 #include <syslog.h>
30 #include <version.h>
32 #include "amiga_api.h"
33 #include "gethtbynamadr.h"
34 #include "miami_api.h"
36 #include <proto/bsdsocket.h>
38 #undef SocketBase
39 #define SocketBase MiamiBase->_SocketBase
40 #define UserGroupBase MiamiBase->_UserGroupBase
42 typedef VOID (* f_void)(APTR args, ...);
44 extern f_void Miami_UserFuncTable[];
45 extern struct ifnet *ifnet;
47 void __MiamiLIB_Cleanup(struct MiamiBase *MiamiBase)
49 void *freestart;
50 IPTR size;
52 #if defined(__AROS__)
53 D(bug("[AROSTCP.MIAMI] miami_api.c: __MiamiLIB_Cleanup()\n"));
54 #endif
56 if (SocketBase)
57 CloseLibrary(&SocketBase->libNode);
59 freestart = (void *)((IPTR)MiamiBase - (IPTR)MiamiBase->Lib.lib_NegSize);
60 size = MiamiBase->Lib.lib_NegSize + MiamiBase->Lib.lib_PosSize;
61 FreeMem(freestart, size);
64 AROS_LH1 (struct Library *, Open,
65 AROS_LHA(ULONG, version, D0),
66 struct Library *, MasterBase, 1, Miami)
68 AROS_LIBFUNC_INIT
70 struct MiamiBase *MiamiBase;
71 WORD *i;
73 #if defined(__AROS__)
74 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiLIB_Open()\n"));
75 #endif
77 D(kprintf("MiamiLIB_Open: 0x%p <%s> OpenCount %ld\n",
78 MasterBase,
79 MasterBase->lib_Node.ln_Name,
80 MasterBase->lib_OpenCnt));
82 MiamiBase = (struct MiamiBase *)MakeLibrary(Miami_UserFuncTable,
83 #if !defined(__AROS__)
84 (UWORD *)&Miami_initTable,
85 #else
86 NULL,
87 #endif
88 NULL,
89 sizeof(struct MiamiBase),
90 BNULL);
91 #if defined(__AROS__)
92 ((struct Library *)MiamiBase)->lib_Node.ln_Type = NT_LIBRARY;
93 ((struct Library *)MiamiBase)->lib_Node.ln_Name = (APTR)MIAMILIBNAME;
94 ((struct Library *)MiamiBase)->lib_Flags = (LIBF_SUMUSED|LIBF_CHANGED);
95 ((struct Library *)MiamiBase)->lib_Version = MIAMI_VERSION;
96 ((struct Library *)MiamiBase)->lib_Revision = MIAMI_REVISION;
97 ((struct Library *)MiamiBase)->lib_IdString = (APTR)RELEASESTRING MIAMI_VSTRING;
99 D(bug("[AROSTCP](miami_api.c) MiamiLIB_Open: Created MIAMI user library base: 0x%p\n", MiamiBase));
100 #endif
101 D(kprintf("Created user miami.library base: 0x%p\n", MiamiBase);)
102 if (MiamiBase) {
103 for (i = (WORD *)((struct Library *)MiamiBase + 1); i < (WORD *)(MiamiBase + 1); i++)
104 *i = 0;
105 MiamiBase->Lib.lib_OpenCnt = 1;
106 SocketBase = (APTR)OpenLibrary("bsdsocket.library", VERSION);
107 if (SocketBase) {
108 D(__log(LOG_DEBUG,"miami.library opened: SocketBase = 0x%p, MiamiBase = 0x%p", (IPTR)SocketBase, (IPTR)MiamiBase);)
109 MasterBase->lib_OpenCnt++;
110 return((struct Library *)MiamiBase);
112 D(else kprintf("Unable to open bsdsocket.library\n");)
113 __MiamiLIB_Cleanup(MiamiBase);
115 return(NULL);
117 AROS_LIBFUNC_EXIT
120 AROS_LH0(ULONG *, Close, struct MiamiBase *, MiamiBase, 2, Miami)
122 AROS_LIBFUNC_INIT
124 #if defined(__AROS__)
125 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiLIB_Close()\n"));
126 #endif
128 D(kprintf("MiamiLIB_Close: 0x%p <%s> OpenCount %ld\n",
129 MiamiBase,
130 MasterMiamiBase->lib_Node.ln_Name,
131 MasterMiamiBase->lib_OpenCnt));
133 if (MiamiBase->_UserGroupBase)
134 CloseLibrary(MiamiBase->_UserGroupBase);
136 __MiamiLIB_Cleanup(MiamiBase);
137 MasterMiamiBase->lib_OpenCnt--;
138 D(kprintf("MiamiLIB_Close: done\n"));
140 return(0);
141 AROS_LIBFUNC_EXIT
145 AROS_LH7(int, MiamiSysCtl,
146 AROS_LHA(LONG *, name, A0),
147 AROS_LHA(ULONG, namelen, D0),
148 AROS_LHA(void *, oldp, A1),
149 AROS_LHA(LONG *, oldlenp, A2),
150 AROS_LHA(void *, newp, A3),
151 AROS_LHA(LONG, newlen, D1),
152 AROS_LHA(int, len, D2),
153 struct MiamiBase *, MiamiBase, 5, Miami
156 AROS_LIBFUNC_INIT
157 #if defined(__AROS__)
158 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiSysCtl()\n"));
159 #endif
161 __log(LOG_CRIT,"MiamiSysCtl() is not implemented");
162 return ENOSYS;
163 AROS_LIBFUNC_EXIT
166 AROS_LH1(void, MiamiDisallowDNS,
167 AROS_LHA(LONG, value, D0),
168 struct MiamiBase *, MiamiBase, 11, Miami
171 AROS_LIBFUNC_INIT
173 #if defined(__AROS__)
174 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiDisallowDNS()\n"));
175 #endif
177 DSYSCALLS(__log(LOG_DEBUG,"MiamiDisallowDNS(%ld) called",value);)
178 if (value)
179 SocketBase->res_state.options |= AROSTCP_RES_DISABLED;
180 else
181 SocketBase->res_state.options &= ~AROSTCP_RES_DISABLED;
183 AROS_LIBFUNC_EXIT
186 AROS_LH0(void *, MiamiGetPid,
187 struct MiamiBase *, MiamiBase, 13, Miami
190 AROS_LIBFUNC_INIT
192 #if defined(__AROS__)
193 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiGetPid()\n"));
194 #endif
196 return FindTask(NULL);
198 AROS_LIBFUNC_EXIT
201 AROS_LH3(APTR, MiamiPFAddHook,
202 AROS_LHA(struct Hook *, hook, A0),
203 AROS_LHA(UBYTE *, interface, A1),
204 AROS_LHA(struct TagItem *, taglist, A2),
205 struct MiamiBase *, MiamiBase, 16, Miami
208 AROS_LIBFUNC_INIT
210 struct packet_filter_hook *pf = NULL;
211 struct ifnet *ifp;
213 #if defined(__AROS__)
214 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiPFAddHook()\n"));
215 #endif
217 #ifdef ENABLE_PACKET_FILTER
218 DPF(__log(LOG_DEBUG,"MiamiPFAddHook(0x%p, %s) called", hook, interface);)
220 ifp = ifunit(interface);
221 DPF(__log(LOG_DEBUG,"ifp = 0x%pn");)
222 if (ifp) {
223 pf = bsd_malloc(sizeof(struct packet_filter_hook), NULL, NULL);
224 DPF(syslog(LOG_DEBUG,"Handle = 0x%p", pf);)
225 if (pf) {
226 pf->pfil_if = ifp;
227 pf->pfil_hook = hook;
228 pf->pfil_hooktype = GetTagData(MIAMITAG_HOOKTYPE, MIAMICPU_M68KREG, taglist);
229 ObtainSemaphore(&pfil_list_lock);
230 AddTail((struct List *)&pfil_list, (struct Node *)pf);
231 ReleaseSemaphore(&pfil_list_lock);
232 DPF(__log(LOG_DEBUG,"Added packet filter hook:");)
233 DPF(__log(LOG_DEBUG,"Function: 0x%p", hook->h_Entry);)
234 DPF(__log(LOG_DEBUG,"CPU type: %lu", pf->pfil_hooktype);)
237 #else
238 __log(LOG_CRIT,"Miami packet filter disabled", NULL);
239 #endif
240 return pf;
242 AROS_LIBFUNC_EXIT
245 AROS_LH1(void, MiamiPFRemoveHook,
246 AROS_LHA(APTR, handle, A0),
247 struct MiamiBase *, MiamiBase, 17, Miami
250 AROS_LIBFUNC_INIT
252 #if defined(__AROS__)
253 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiPFRemoveHook()\n"));
254 #endif
256 DPF(log("MiamiPFRemoveHook(0x%p) called", handle);)
257 if (handle) {
258 ObtainSemaphore(&pfil_list_lock);
259 Remove(handle);
260 ReleaseSemaphore(&pfil_list_lock);
261 bsd_free(handle, NULL);
264 AROS_LIBFUNC_EXIT
267 AROS_LH1(int, MiamiGetHardwareLen,
268 AROS_LHA(char *, name, A0),
269 struct MiamiBase *, MiamiBase, 18, Miami
272 AROS_LIBFUNC_INIT
274 #if defined(__AROS__)
275 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiGetHardwareLen()\n"));
276 #endif
278 __log(LOG_CRIT,"MiamiGetHardwareLen() is not implemented");
279 return 0;
281 AROS_LIBFUNC_EXIT
284 AROS_LH1(struct Library *, MiamiOpenSSL,
285 AROS_LHA(struct TagItem *, taglist, A0),
286 struct MiamiBase *, MiamiBase, 25, Miami
289 AROS_LIBFUNC_INIT
291 #if defined(__AROS__)
292 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiOpenSSL()\n"));
293 #endif
294 return NULL;
296 AROS_LIBFUNC_EXIT
299 AROS_LH0(void, MiamiCloseSSL,
300 struct MiamiBase *, MiamiBase, 26, Miami
303 AROS_LIBFUNC_INIT
305 #if defined(__AROS__)
306 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiCloseSSL()\n"));
307 #endif
309 AROS_LIBFUNC_EXIT
312 AROS_LH2(int, MiamiSetSocksConn,
313 AROS_LHA(struct sockaddr *, sa, A0),
314 AROS_LHA(int, len, D0),
315 struct MiamiBase *, MiamiBase, 33, Miami
318 AROS_LIBFUNC_INIT
320 #if defined(__AROS__)
321 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiSetSocksConn()\n"));
322 #endif
323 __log(LOG_CRIT,"MiamiSetSocksConn() is not implemented");
324 return FALSE;
326 AROS_LIBFUNC_EXIT
329 AROS_LH1(int, MiamiIsOnline,
330 AROS_LHA(char *, name, A0),
331 struct MiamiBase *, MiamiBase, 35, Miami
334 AROS_LIBFUNC_INIT
336 struct ifnet *ifp;
337 long online = FALSE;
339 #if defined(__AROS__)
340 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiIsOnline()\n"));
341 #endif
343 DSYSCALLS(__log(LOG_DEBUG,"MiamiIsOnline(%s) called", (ULONG)(name ? name : "<NULL>"));)
344 if (name && strcmp(name,"mi0")) {
345 ifp = ifunit(name);
346 if (ifp)
347 online = (ifp->if_flags & IFF_UP) ? TRUE : FALSE;
348 } else {
349 for (ifp = ifnet; ifp; ifp = ifp->if_next) {
350 DSYSCALLS(__log(LOG_DEBUG,"Checking interface %s%u",ifp->if_name, ifp->if_unit);)
351 if ((ifp->if_flags & (IFF_UP | IFF_LOOPBACK)) == IFF_UP) {
352 online = TRUE;
353 break;
357 DSYSCALLS(__log(LOG_DEBUG,"MiamiIsOnline() result: %ld", online);)
358 return online;
360 AROS_LIBFUNC_EXIT
363 AROS_LH2(void, MiamiOnOffline,
364 AROS_LHA(char *, name, A0),
365 AROS_LHA(int, online, D0),
366 struct MiamiBase *, MiamiBase, 36, Miami
369 AROS_LIBFUNC_INIT
371 struct ifnet *ifp;
373 #if defined(__AROS__)
374 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiOnOffline()\n"));
375 #endif
377 ifp = ifunit(name);
378 if (ifp)
379 ifupdown(ifp, online);
381 AROS_LIBFUNC_EXIT
384 AROS_LH4(STRPTR, inet_ntop,
385 AROS_LHA(LONG, family, D0),
386 AROS_LHA(char *, addrptr, A0),
387 AROS_LHA(char *, strptr, A1),
388 AROS_LHA(LONG, len, D1),
389 struct MiamiBase *, MiamiBase, 38, Miami
392 AROS_LIBFUNC_INIT
394 #if defined(__AROS__)
395 D(bug("[AROSTCP.MIAMI] miami_api.c: inet_ntop()\n"));
396 #endif
398 DSYSCALLS(__log(LOG_DEBUG,"inet_ntop(%ld) called",family);)
399 if (family == AF_INET)
401 sprintf(strptr, "%u.%u.%u.%u", addrptr[0], addrptr[1], addrptr[2], addrptr[3]);
402 return addrptr;
403 } else {
404 __log(LOG_CRIT,"inet_ntop(): address family %ld is not implemented", family);
405 return NULL;
408 AROS_LIBFUNC_EXIT
411 AROS_LH2(int, Miami_inet_aton,
412 AROS_LHA(char *, strptr, A0),
413 AROS_LHA(void *, addrptr, A2),
414 struct MiamiBase *, MiamiBase, 39, Miami
417 AROS_LIBFUNC_INIT
419 #if defined(__AROS__)
420 D(bug("[AROSTCP.MIAMI] miami_api.c: Miami_inet_aton()\n"));
421 #endif
423 DSYSCALLS(syslog(LOG_DEBUG,"inet_aton(%s) called", (ULONG)strptr);)
424 return __inet_aton(strptr, addrptr);
426 AROS_LIBFUNC_EXIT
429 AROS_LH3(int, inet_pton,
430 AROS_LHA(LONG, family, D0),
431 AROS_LHA(char *, strptr, A0),
432 AROS_LHA(void *, addrptr, A1),
433 struct MiamiBase *, MiamiBase, 40, Miami
436 AROS_LIBFUNC_INIT
438 #if defined(__AROS__)
439 D(bug("[AROSTCP.MIAMI] miami_api.c: inet_pton()\n"));
440 #endif
442 DSYSCALLS(__log(LOG_DEBUG,"inet_pton(%ld, %s) called", family, (ULONG)strptr);)
443 if (family == AF_INET)
444 return __inet_aton(strptr, addrptr);
445 else {
446 __log(LOG_CRIT,"inet_pton(): address family %ld is not implemented", family);
447 return 0;
450 AROS_LIBFUNC_EXIT
453 AROS_LH2(struct hostent *, gethostbyname2,
454 AROS_LHA(const char *, name, A0),
455 AROS_LHA(LONG, family, D0),
456 struct MiamiBase *, MiamiBase, 41, Miami
459 AROS_LIBFUNC_INIT
461 #if defined(__AROS__)
462 D(bug("[AROSTCP.MIAMI] miami_api.c: gethostbyname2()\n"));
463 #endif
465 DSYSCALLS(__log(LOG_DEBUG,"gethostbyname2(%s, %ld) called", (ULONG)name, family);)
466 if (family == AF_INET)
467 return __gethostbyname(name, SocketBase);
468 else {
469 syslog(LOG_CRIT,"gethostbyname2(): address family %ld is not implemented", family);
470 return NULL;
473 AROS_LIBFUNC_EXIT
476 char *ai_errors[] = {
477 "No error",
478 "Address family for host not supported",
479 "Temporary failure in name resolution",
480 "Invalid flags value",
481 "Non-recoverable failure in name resolution",
482 "Address family not supported",
483 "Memory allocation failure",
484 "No address associated with host",
485 "Host nor service provided, or not known",
486 "Service not supported for socket type",
487 "Socket type not supported",
488 "System error",
489 "Unknown error"
492 AROS_LH1(char *, gai_strerror,
493 AROS_LHA(LONG, error, D0),
494 struct MiamiBase *, MiamiBase, 42, Miami
497 AROS_LIBFUNC_INIT
499 #if defined(__AROS__)
500 D(bug("[AROSTCP.MIAMI] miami_api.c: gai_strerror()\n"));
501 #endif
503 DSYSCALLS(__log(LOG_DEBUG,"gai_strerror(%ld) called", error);)
504 if (error > 12)
505 error = 12;
506 return ai_errors[error];
508 AROS_LIBFUNC_EXIT
511 AROS_LH1(void, freeaddrinfo,
512 AROS_LHA(struct addrinfo *, addrinfo, A0),
513 struct MiamiBase *, MiamiBase, 43, Miami
516 AROS_LIBFUNC_INIT
518 #if defined(__AROS__)
519 D(bug("[AROSTCP.MIAMI] miami_api.c: freeaddrinfo()\n"));
520 #endif
522 AROS_LIBFUNC_EXIT
525 AROS_LH4(LONG, getaddrinfo,
526 AROS_LHA(char *, hostname, A0),
527 AROS_LHA(char *, servicename, A1),
528 AROS_LHA(struct addrinfo *, hintsp, A2),
529 AROS_LHA(struct addrinfo **, result, A3),
530 struct MiamiBase *, MiamiBase, 44, Miami
533 AROS_LIBFUNC_INIT
535 #if defined(__AROS__)
536 D(bug("[AROSTCP.MIAMI] miami_api.c: getaddrinfo()\n"));
537 #endif
539 __log(LOG_CRIT,"getaddrinfo() is not implemented");
540 writeErrnoValue(SocketBase, ENOSYS);
541 return EAI_SYSTEM;
543 AROS_LIBFUNC_EXIT
546 AROS_LH7(LONG, getnameinfo,
547 AROS_LHA(struct sockaddr *, sockaddr, A0),
548 AROS_LHA(LONG, addrlen, D0),
549 AROS_LHA(char *, hostname, A1),
550 AROS_LHA(LONG, hostlen, D1),
551 AROS_LHA(char *, servicename, A2),
552 AROS_LHA(LONG, servicelen, D2),
553 AROS_LHA(LONG, flags, D3),
554 struct MiamiBase *, MiamiBase, 45, Miami
557 AROS_LIBFUNC_INIT
559 #if defined(__AROS__)
560 D(bug("[AROSTCP.MIAMI] miami_api.c: getnameinfo()\n"));
561 #endif
563 __log(LOG_CRIT,"getnameinfo() is not implemented");
564 return ENOSYS;
566 AROS_LIBFUNC_EXIT
569 AROS_LH0(LONG, MiamiSupportsIPV6,
570 struct MiamiBase *, MiamiBase, 50, Miami
573 AROS_LIBFUNC_INIT
575 #if defined(__AROS__)
576 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiSupportsIPV6()\n"));
577 #endif
579 DSYSCALLS(__log(LOG_DEBUG,"MiamiSupportsIPV6() called");)
580 return FALSE;
582 AROS_LIBFUNC_EXIT
585 AROS_LH0(LONG, MiamiGetResOptions,
586 struct MiamiBase *, MiamiBase, 51, Miami
589 AROS_LIBFUNC_INIT
591 #if defined(__AROS__)
592 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiResGetOptions()\n"));
593 #endif
595 DSYSCALLS(__log(LOG_DEBUG,"MiamiResGetOptions() called, result: 0x%p", SocketBase.res_state.options);)
596 return SocketBase->res_state.options;
598 AROS_LIBFUNC_EXIT
601 AROS_LH1(void, MiamiSetResOptions,
602 AROS_LHA(LONG, options, D0),
603 struct MiamiBase *, MiamiBase, 52, Miami
606 AROS_LIBFUNC_INIT
608 #if defined(__AROS__)
609 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiResSetOptions()\n"));
610 #endif
612 DSYSCALLS(__log(LOG_DEBUG,"MiamiResSetOptions(0x%p) called", options);)
613 SocketBase->res_state.options = options;
615 AROS_LIBFUNC_EXIT
618 AROS_LH1(LONG, sockatmark,
619 AROS_LHA(LONG, sockfd, D0),
620 struct MiamiBase *, MiamiBase, 53, Miami
623 AROS_LIBFUNC_INIT
625 #if defined(__AROS__)
626 D(bug("[AROSTCP.MIAMI] miami_api.c: sockatmark()\n"));
627 #endif
629 __log(LOG_CRIT,"sockatmark() is not implemented");
630 return 0;
632 AROS_LIBFUNC_EXIT
635 AROS_LH3(void, MiamiSupportedCPUs,
636 AROS_LHA(ULONG *, apis, A0),
637 AROS_LHA(ULONG *, callbacks, A1),
638 AROS_LHA(ULONG *, kernel, A2),
639 struct MiamiBase *, MiamiBase, 54, Miami
642 AROS_LIBFUNC_INIT
644 #if defined(__AROS__)
645 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiSupportedCPUs()\n"));
646 #endif
648 DSYSCALLS(__log(LOG_DEBUG,"MiamiSupportedCPUs() called");)
649 *apis = MIAMICPU_M68KREG;
650 *callbacks = MIAMICPU_M68KREG;
651 *kernel = MIAMICPU_PPCV4;
653 AROS_LIBFUNC_EXIT
656 AROS_LH1(LONG, MiamiGetFdCallback,
657 AROS_LHA(fdCallback_t *, cbptr, A0),
658 struct MiamiBase *, MiamiBase, 55, Miami
661 AROS_LIBFUNC_INIT
663 #if defined(__AROS__)
664 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiGetFdCallback()\n"));
665 #endif
667 *cbptr = SocketBase->fdCallback;
668 DSYSCALLS(__log(LOG_DEBUG,"MiamiGetFdCallback() called, *cbptr = 0x%p", (ULONG)*cbptr);)
669 return *cbptr ? MIAMICPU_M68KREG : 0;
671 AROS_LIBFUNC_EXIT
674 AROS_LH2(LONG, MiamiSetFdCallback,
675 AROS_LHA(fdCallback_t, cbptr, A0),
676 AROS_LHA(LONG, cputype, D0),
677 struct MiamiBase *, MiamiBase, 56, Miami
680 AROS_LIBFUNC_INIT
682 #if defined(__AROS__)
683 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiSetFdCallback()\n"));
684 #endif
686 DSYSCALLS(__log(LOG_DEBUG,"MiamiSetFdCallback(0x%p, %ld) called", (ULONG)cbptr, cputype);)
687 if (cputype == MIAMICPU_M68KREG) {
688 SocketBase->fdCallback = cbptr;
689 return TRUE;
690 } else
691 return FALSE;
693 AROS_LIBFUNC_EXIT
696 AROS_LH0(void, SetSysLogPort,
697 struct MiamiBase *, MiamiBase, 6, Miami
700 AROS_LIBFUNC_INIT
702 #if defined(__AROS__)
703 D(bug("[AROSTCP.MIAMI] miami_api.c: SetSysLogPort()\n"));
704 #endif
706 DSYSCALLS(__log(LOG_DEBUG,"SetSysLogPort() called");)
707 ExtLogPort = FindPort("SysLog");
709 AROS_LIBFUNC_EXIT
712 AROS_LH2(int, Miami_sethostname,
713 AROS_LHA(const char *, name, A0),
714 AROS_LHA(size_t, namelen, D0),
715 struct MiamiBase *, MiamiBase, 23, Miami
718 AROS_LIBFUNC_INIT
720 #if defined(__AROS__)
721 D(bug("[AROSTCP.MIAMI] miami_api.c: Miami_sethostname()\n"));
722 #endif
724 return sethostname(name, namelen);
726 AROS_LIBFUNC_EXIT
729 AROS_LH2(void, Miami_QueryInterfaceTagList,
730 AROS_LHA(STRPTR, interface_name, A0),
731 AROS_LHA(struct TagItem *, tags, A1),
732 struct MiamiBase *, MiamiBase, 7, Miami
735 AROS_LIBFUNC_INIT
737 #if defined(__AROS__)
738 D(bug("[AROSTCP.MIAMI] miami_api.c: Miami_QueryInterfaceTagList()\n"));
739 #endif
740 // "return" removed, because we are a void function
741 __QueryInterfaceTagList(interface_name, tags, SocketBase);
743 AROS_LIBFUNC_EXIT
746 AROS_LH0(struct UserGroupCredentials *, MiamiGetCredentials,
747 struct MiamiBase *, MiamiBase, 58, Miami)
749 AROS_LIBFUNC_INIT
751 #if defined(__AROS__)
752 D(bug("[AROSTCP.MIAMI] miami_api.c: MiamiGetCredentials()\n"));
753 #endif
755 /* We don't want to have this library at all, so we open it only if we really need it */
756 if (!UserGroupBase)
757 UserGroupBase = OpenLibrary("usergroup.library",4);
759 DSYSCALLS(__log(LOG_DEBUG,"MiamiGetCredentials(): UserGroupBase = 0x%p", (IPTR)UserGroupBase);)
760 /* TODO: uncomment the following lines once we have a working usergroups.library implemenetation */
761 // if (UserGroupBase)
762 // return getcredentials(NULL);
764 return NULL;
766 AROS_LIBFUNC_EXIT