Compare commits

...

4 Commits
0.27 ... master

Author SHA1 Message Date
901072385e Fix build
All checks were successful
Altlinux build / build-alt (push) Successful in 2m40s
Archlinux build / build-arch (push) Successful in 2m57s
Archlinux build / make-test (push) Successful in 1m0s
Debian build / build-ubuntu (push) Successful in 3m55s
2025-05-01 18:29:59 +03:00
926124dffc Fix uint32 types unknown
All checks were successful
Altlinux build / build-alt (push) Successful in 2m41s
Archlinux build / build-arch (push) Successful in 2m57s
Archlinux build / make-test (push) Successful in 1m0s
Debian build / build-ubuntu (push) Successful in 3m47s
2025-05-01 18:29:11 +03:00
5eb6ddc45b Endianness check
Some checks failed
Altlinux build / build-alt (push) Failing after 2m3s
Archlinux build / build-arch (push) Successful in 2m58s
Debian build / build-ubuntu (push) Has been cancelled
Archlinux build / make-test (push) Has been cancelled
2025-05-01 18:10:15 +03:00
144eacc0d6 Small FAQ change, nodelist investigation of aarch64 broken index
All checks were successful
Altlinux build / build-alt (push) Successful in 2m42s
Archlinux build / build-arch (push) Successful in 2m56s
Archlinux build / make-test (push) Successful in 1m0s
Debian build / build-ubuntu (push) Successful in 3m47s
2025-05-01 15:50:30 +03:00
5 changed files with 44 additions and 13 deletions

15
FAQ
View File

@ -108,9 +108,10 @@ A: /AK/
override <фидоадрес> [hidden] [Phone <тлф>] [Ipaddr <dns|ip>] [Flags <флаги>]
ip-адрес/днс-имя сервера можно подменить как через Ipaddr, так и через
флаги, поставив INA:адрес
Пример override:
[ÆÌÁÇÉ ÎÏÄÌÉÓÔÁ: CM,IBN,INA:coolbbs.spb.ru,INA:cool2.spb.ru,BEER:lager
override 2:5030/xxx Phone Unpublished Flags IFC,INA:reservbbs.dyndns.org \
1) [ÆÌÁÇÉ ÎÏÄÌÉÓÔÁ: CM,IBN,INA:coolbbs.spb.ru,INA:cool2.spb.ru,BEER:lager]
override 2:5030/xxx hidden Flags IFC,INA:reservbbs.dyndns.org \
hidden Ipaddr 188.34.34.22 \
hidden Ipaddr 234.43.44.23 Flags IFC,CM
@ -120,6 +121,16 @@ A: /AK/
3. 188.34.34.22:binkp
4. 234.43.44.23:ifcico
5. cool2.spb.ru:binkp
2) [ÆÌÁÇÉ ÎÏÄÌÉÓÔÁ: CM,IBN,IFC,INA:coolbbs3.spb.ru,BEER:porter]
override 2:5030/xxx Phone None Flags IFC,INA:rybak3.dyndns.org \
hidden Ipaddr 188.34.35.22
ðÏÒÑÄÏË ÄÏÚ×ÏÎÁ (ÄÏ ÐÅÒ×ÏÇÏ ÕÓÐÅÛÎÏÇÏ ÕÓÔÁÎÏ×ÌÅÎÉÑ ÓÅÓÓÉÉ):
1. rybak3.dyndns.org:ifcico
3. 188.34.35.22:ifcico
override ÂÅÚ ÏÐÃÉÉ hidden ÚÁÍÅÎÑÅÔ ÎÏÄÌÉÓÔÏ×ÙÅ ÐÏÌÑ!
Проверить настроенные override-s и порядок дозвона можно с помощью
программы nlookup: опция -o показывает override, опция -t - порядок
дозвона (IP+PSTN)

View File

@ -582,7 +582,7 @@ s_nodelist *nodelist_open(const char *dir, char *name, int mode)
return NULL;
}
}
DEB((D_NODELIST, "nodelist_open: endianness = %x", (uint32_t) tmp.endian));
return xmemcpy(&tmp, sizeof(s_nodelist));
}
@ -630,6 +630,7 @@ int nodelist_checkheader(s_nodelist *nlp)
(long)nlstat.st_size, (long)nlsize);
return -1;
}
nlp->endian = buffer_getlong(buffer + 12);
return 0;
}
@ -660,7 +661,7 @@ int nodelist_createheader(s_nodelist *nlp)
buffer_putlong(hdrbuf + 0, nlstat.st_mtime);
buffer_putlong(hdrbuf + 4, nlstat.st_size);
buffer_putlong(hdrbuf + 12, (long) 0xDEADBEEF);
if( fseek(nlp->fp_index, 0L, SEEK_SET) == -1 )
{
logerr("cannot seek to zero offset of index");
@ -717,7 +718,9 @@ int nodelist_putindex(s_nodelist *nlp, const s_bni *bni)
buffer_putint(buffer + 6, bni->point);
buffer_putint(buffer + 8, bni->hub);
buffer_putlong(buffer + 10, bni->offset);
if (bni->point != 0) {
DEB((D_NODELIST, "nodelist: findindex found point z: %d, n: %d, l: %d, p: %d, offset: %l", bni->zone, bni->net, bni->node, bni->point, bni->offset));
}
if( fwrite(buffer, sizeof(buffer), 1, nlp->fp_index) != 1 )
{
logerr("error writing nodelist index file \"%s\"", nlp->name_index);
@ -752,6 +755,10 @@ int nodelist_findindex(s_nodelist *nlp, s_bni *bni, s_faddr addr)
bni->point = buffer_getint(p + 6);
bni->hub = buffer_getint(p + 8);
bni->offset = buffer_getlong(p + 10);
if ((uint32_t)nlp->endian == 0xBEEFDEAD) {
swap_long((char *)&bni->offset);
}
DEB((D_NODELIST, "nodelist: findindex found" ));
return 0;
}
p += NODELIST_ENTRYSIZE;
@ -800,7 +807,7 @@ int nodelist_lookup_string(char *buffer, size_t buflen, s_faddr addr)
if( !rc )
rc = nodelist_getstr(nlp, bni.offset, buffer, buflen);
nodelist_close(nlp);
if( !rc )
@ -856,5 +863,6 @@ void nodelist_initnode(s_node *node, s_faddr addr)
strcpy(node->sysop, "<none>");
strcpy(node->location, "<none>");
strcpy(node->phone, "<none>");
strcpy(node->flags, "<none>");
}

View File

@ -290,10 +290,10 @@ char *buffer_putint(char *buffer, int val)
*/
long buffer_getlong(const char *buffer)
{
return ( (unsigned long) ((unsigned char) buffer[0]) )
| ( (unsigned long) ((unsigned char) buffer[1]) << 8 )
| ( (unsigned long) ((unsigned char) buffer[2]) << 16 )
| ( (unsigned long) ((unsigned char) buffer[3]) << 24 );
return (long)( (unsigned long) ((unsigned char) buffer[0]) )
| ( (unsigned long) ((unsigned char) buffer[1]) << 8 )
| ( (unsigned long) ((unsigned char) buffer[2]) << 16 )
| ( (unsigned long) ((unsigned char) buffer[3]) << 24 );
}
/*****************************************************************************
@ -307,8 +307,17 @@ long buffer_getlong(const char *buffer)
*/
int buffer_getint(const char *buffer)
{
return ( (unsigned int) ((unsigned char) buffer[0]) )
| ( (unsigned int) ((unsigned char) buffer[1]) << 8 );
return (int)( (unsigned int) ((unsigned char) buffer[0]) )
| ( (unsigned int) ((unsigned char) buffer[1]) << 8 );
}
void swap_long(char *buffer){
char *temp = xmemcpy(buffer, sizeof(uint32_t));
temp[0] = buffer[2];
temp[1] = buffer[3];
temp[2] = buffer[0];
temp[3] = buffer[1];
memcpy(buffer,temp,sizeof(uint32_t));
}
void printf_usage(const char *ident, const char *fmt, ...)

View File

@ -27,7 +27,7 @@
* 0x0000 4 bytes Nodelist file date
* 0x0004 4 bytes Nodelist file size
* 0x0008 4 bytes Total number of entries in index file
* 0x000c 4 bytes Unused
* 0x000c 4 bytes ENDIANNES MARK
*
* Nodelist index is an array of next entries:
*
@ -123,6 +123,7 @@ typedef struct nodelist
char name_index[BF_MAXPATH+1];
char name_nodelist[BF_MAXPATH+1];
long entries;
long endian;
}
s_nodelist;

View File

@ -189,8 +189,10 @@ char *buffer_putlong(char *buffer, long val);
char *buffer_putint(char *buf, int val);
long buffer_getlong(const char *buf);
int buffer_getint(const char *buf);
void swap_long(char *buffer);
void printf_usage(const char *ident, const char *fmt, ...);
/* u_pkt.c */
int pkt_createpacket(const char *pktname, const s_packet *pkt);