merge
This commit is contained in:
commit
a59aa24a94
8 changed files with 169 additions and 50 deletions
|
@ -165,6 +165,8 @@
|
||||||
014D _o ō latin small letter o macron
|
014D _o ō latin small letter o macron
|
||||||
014E uO Ŏ latin capital letter o breve
|
014E uO Ŏ latin capital letter o breve
|
||||||
014F uo ŏ latin small letter o breve
|
014F uo ŏ latin small letter o breve
|
||||||
|
0150 hO Ő latin capital letter o double acute
|
||||||
|
0151 ho ő latin small letter o double acute
|
||||||
0152 OE Œ latin capital letter o e
|
0152 OE Œ latin capital letter o e
|
||||||
0153 oe œ latin small letter o e
|
0153 oe œ latin small letter o e
|
||||||
0154 'R Ŕ latin capital letter r acute
|
0154 'R Ŕ latin capital letter r acute
|
||||||
|
@ -426,6 +428,7 @@
|
||||||
208C b= ₌ subscript equals sign
|
208C b= ₌ subscript equals sign
|
||||||
208D b( ₍ subscript opening parenthesis
|
208D b( ₍ subscript opening parenthesis
|
||||||
208E b) ₎ subscript closing parenthesis
|
208E b) ₎ subscript closing parenthesis
|
||||||
|
208F bN subscript latin small letter n
|
||||||
20AC e$ € euro symbol
|
20AC e$ € euro symbol
|
||||||
2102 CC ℂ double-struck capital c
|
2102 CC ℂ double-struck capital c
|
||||||
210A $g ℊ script small g
|
210A $g ℊ script small g
|
||||||
|
@ -548,6 +551,8 @@
|
||||||
262D SU ☭ hammer and sickle
|
262D SU ☭ hammer and sickle
|
||||||
2639 :( ☹ sad face
|
2639 :( ☹ sad face
|
||||||
263A :) ☺ smiley face
|
263A :) ☺ smiley face
|
||||||
|
2640 fs ♀ female sign
|
||||||
|
2642 ms ♂ male sign
|
||||||
2654 wk ♔ white chess king
|
2654 wk ♔ white chess king
|
||||||
2655 wq ♕ white chess queen
|
2655 wq ♕ white chess queen
|
||||||
2656 wr ♖ white chess rook
|
2656 wr ♖ white chess rook
|
||||||
|
|
|
@ -507,7 +507,7 @@ ipifcadd(Ipifc *ifc, char **argv, int argc, int tentative, Iplifc *lifcp)
|
||||||
return up->errstr;
|
return up->errstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mtu >= ifc->m->mintu && mtu <= ifc->m->maxtu)
|
if(mtu > 0 && mtu >= ifc->m->mintu && mtu <= ifc->m->maxtu)
|
||||||
ifc->maxtu = mtu;
|
ifc->maxtu = mtu;
|
||||||
|
|
||||||
/* ignore if this is already a local address for this ifc */
|
/* ignore if this is already a local address for this ifc */
|
||||||
|
|
|
@ -118,8 +118,9 @@ EFI_GUID EFI_PXE_BASE_CODE_PROTOCOL_GUID = {
|
||||||
static
|
static
|
||||||
EFI_PXE_BASE_CODE_PROTOCOL *pxe;
|
EFI_PXE_BASE_CODE_PROTOCOL *pxe;
|
||||||
|
|
||||||
static
|
static uchar mymac[6];
|
||||||
EFI_PXE_BASE_CODE_DHCPV4_PACKET *dhcp;
|
static uchar myip[16];
|
||||||
|
static uchar serverip[16];
|
||||||
|
|
||||||
typedef struct Tftp Tftp;
|
typedef struct Tftp Tftp;
|
||||||
struct Tftp
|
struct Tftp
|
||||||
|
@ -310,25 +311,109 @@ pxeopen(char *name)
|
||||||
Tftp *t = (Tftp*)((uintptr)(buf+7)&~7);
|
Tftp *t = (Tftp*)((uintptr)(buf+7)&~7);
|
||||||
|
|
||||||
memset(t, 0, sizeof(Tftp));
|
memset(t, 0, sizeof(Tftp));
|
||||||
|
memmove(&t->sip, myip, sizeof(myip));
|
||||||
memmove(&t->dip, dhcp->BootpSiAddr, 4);
|
memmove(&t->dip, serverip, sizeof(serverip));
|
||||||
memmove(&t->sip, pxe->Mode->StationIp, 4);
|
|
||||||
|
|
||||||
if(tftpopen(t, name))
|
if(tftpopen(t, name))
|
||||||
return nil;
|
return nil;
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
parseipv6(uchar to[16], char *from)
|
||||||
|
{
|
||||||
|
int i, dig, elipsis;
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
elipsis = 0;
|
||||||
|
memset(to, 0, 16);
|
||||||
|
for(i = 0; i < 16; i += 2){
|
||||||
|
dig = 0;
|
||||||
|
for(p = from;; p++){
|
||||||
|
if(*p >= '0' && *p <= '9')
|
||||||
|
dig = (dig << 4) | (*p - '0');
|
||||||
|
else if(*p >= 'a' && *p <= 'f')
|
||||||
|
dig = (dig << 4) | (*p - 'a'+10);
|
||||||
|
else if(*p >= 'A' && *p <= 'F')
|
||||||
|
dig = (dig << 4) | (*p - 'A'+10);
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
if(dig > 0xFFFF)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
to[i] = dig>>8;
|
||||||
|
to[i+1] = dig;
|
||||||
|
if(*p == ':'){
|
||||||
|
if(*++p == ':'){ /* :: is elided zero short(s) */
|
||||||
|
if (elipsis)
|
||||||
|
return -1; /* second :: */
|
||||||
|
elipsis = i+2;
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
} else if (p == from)
|
||||||
|
break;
|
||||||
|
from = p;
|
||||||
|
}
|
||||||
|
if(i < 16){
|
||||||
|
memmove(&to[elipsis+16-i], &to[elipsis], i-elipsis);
|
||||||
|
memset(&to[elipsis], 0, 16-i);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
parsedhcp(EFI_PXE_BASE_CODE_DHCPV4_PACKET *dhcp)
|
||||||
|
{
|
||||||
|
uchar *p, *e;
|
||||||
|
char *x;
|
||||||
|
int opt;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
memset(mymac, 0, sizeof(mymac));
|
||||||
|
memset(serverip, 0, sizeof(serverip));
|
||||||
|
|
||||||
|
/* DHCPv4 */
|
||||||
|
if(pxe->Mode->UsingIpv6 == 0){
|
||||||
|
memmove(mymac, dhcp->BootpHwAddr, 6);
|
||||||
|
memmove(serverip, dhcp->BootpSiAddr, 4);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DHCPv6 */
|
||||||
|
e = (uchar*)dhcp + sizeof(*dhcp);
|
||||||
|
p = (uchar*)dhcp + 4;
|
||||||
|
while(p+4 <= e){
|
||||||
|
opt = p[0]<<8 | p[1];
|
||||||
|
len = p[2]<<8 | p[3];
|
||||||
|
p += 4;
|
||||||
|
if(p + len > e)
|
||||||
|
break;
|
||||||
|
switch(opt){
|
||||||
|
case 1: /* Client DUID */
|
||||||
|
memmove(mymac, p+len-6, 6);
|
||||||
|
break;
|
||||||
|
case 59: /* Boot File URL */
|
||||||
|
for(x = (char*)p; x < (char*)p+len; x++){
|
||||||
|
if(*x == '['){
|
||||||
|
parseipv6(serverip, x+1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
p += len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pxeinit(void **pf)
|
pxeinit(void **pf)
|
||||||
{
|
{
|
||||||
|
EFI_PXE_BASE_CODE_DHCPV4_PACKET *dhcp;
|
||||||
EFI_PXE_BASE_CODE_MODE *mode;
|
EFI_PXE_BASE_CODE_MODE *mode;
|
||||||
EFI_HANDLE *Handles;
|
EFI_HANDLE *Handles;
|
||||||
UINTN Count;
|
UINTN Count;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
pxe = nil;
|
pxe = nil;
|
||||||
dhcp = nil;
|
|
||||||
Count = 0;
|
Count = 0;
|
||||||
Handles = nil;
|
Handles = nil;
|
||||||
if(eficall(ST->BootServices->LocateHandleBuffer,
|
if(eficall(ST->BootServices->LocateHandleBuffer,
|
||||||
|
@ -341,7 +426,7 @@ pxeinit(void **pf)
|
||||||
Handles[i], &EFI_PXE_BASE_CODE_PROTOCOL_GUID, &pxe))
|
Handles[i], &EFI_PXE_BASE_CODE_PROTOCOL_GUID, &pxe))
|
||||||
continue;
|
continue;
|
||||||
mode = pxe->Mode;
|
mode = pxe->Mode;
|
||||||
if(mode == nil || mode->UsingIpv6 || mode->Started == 0)
|
if(mode == nil || mode->Started == 0)
|
||||||
continue;
|
continue;
|
||||||
if(mode->DhcpAckReceived){
|
if(mode->DhcpAckReceived){
|
||||||
dhcp = (EFI_PXE_BASE_CODE_DHCPV4_PACKET*)mode->DhcpAck;
|
dhcp = (EFI_PXE_BASE_CODE_DHCPV4_PACKET*)mode->DhcpAck;
|
||||||
|
@ -355,19 +440,20 @@ pxeinit(void **pf)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
Found:
|
Found:
|
||||||
|
parsedhcp(dhcp);
|
||||||
|
memmove(myip, mode->StationIp, 16);
|
||||||
|
|
||||||
open = pxeopen;
|
open = pxeopen;
|
||||||
read = pxeread;
|
read = pxeread;
|
||||||
close = pxeclose;
|
close = pxeclose;
|
||||||
|
|
||||||
if(pf != nil){
|
if(pf != nil){
|
||||||
char ini[24];
|
char ini[24];
|
||||||
uchar *mac;
|
|
||||||
|
|
||||||
mac = dhcp->BootpHwAddr;
|
|
||||||
memmove(ini, "/cfg/pxe/", 9);
|
memmove(ini, "/cfg/pxe/", 9);
|
||||||
for(i=0; i<6; i++){
|
for(i=0; i<6; i++){
|
||||||
ini[9+i*2+0] = hex[mac[i] >> 4];
|
ini[9+i*2+0] = hex[mymac[i] >> 4];
|
||||||
ini[9+i*2+1] = hex[mac[i] & 0xF];
|
ini[9+i*2+1] = hex[mymac[i] & 0xF];
|
||||||
}
|
}
|
||||||
ini[9+12] = '\0';
|
ini[9+12] = '\0';
|
||||||
if((*pf = pxeopen(ini)) == nil)
|
if((*pf = pxeopen(ini)) == nil)
|
||||||
|
|
|
@ -355,7 +355,7 @@ ficonv(int *dst, uchar *src, int bits, int skip, int count)
|
||||||
else if(d < -1.0)
|
else if(d < -1.0)
|
||||||
*dst++ = MININT;
|
*dst++ = MININT;
|
||||||
else
|
else
|
||||||
*dst++ = d*((float)MAXINT);
|
*dst++ = d*((double)MAXINT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1081,12 +1081,8 @@ netinit(int background)
|
||||||
Network *np;
|
Network *np;
|
||||||
|
|
||||||
if(background){
|
if(background){
|
||||||
switch(rfork(RFPROC|RFNOTEG|RFMEM|RFNOWAIT)){
|
if(rfork(RFPROC|RFNOTEG|RFMEM|RFNOWAIT) != 0)
|
||||||
case 0:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
qlock(&netlock);
|
qlock(&netlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1627,6 +1623,43 @@ slave(char *host)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
mountdns(void)
|
||||||
|
{
|
||||||
|
static QLock mountlock;
|
||||||
|
static int mounted;
|
||||||
|
char buf[128], *p;
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
if(mounted)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
qlock(&mountlock);
|
||||||
|
snprint(buf, sizeof(buf), "%s/dns", mntpt);
|
||||||
|
if(access(buf, AEXIST) == 0)
|
||||||
|
goto done;
|
||||||
|
if(strcmp(mntpt, "/net") == 0)
|
||||||
|
snprint(buf, sizeof(buf), "/srv/dns");
|
||||||
|
else {
|
||||||
|
snprint(buf, sizeof(buf), "/srv/dns%s", mntpt);
|
||||||
|
while((p = strchr(buf+8, '/')) != nil)
|
||||||
|
*p = '_';
|
||||||
|
}
|
||||||
|
if((fd = open(buf, ORDWR)) < 0){
|
||||||
|
err:
|
||||||
|
qunlock(&mountlock);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if(mount(fd, -1, mntpt, MAFTER, "") < 0){
|
||||||
|
close(fd);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
done:
|
||||||
|
mounted = 1;
|
||||||
|
qunlock(&mountlock);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static Ndbtuple*
|
static Ndbtuple*
|
||||||
dnsip6lookup(char *mntpt, char *buf, Ndbtuple *t)
|
dnsip6lookup(char *mntpt, char *buf, Ndbtuple *t)
|
||||||
{
|
{
|
||||||
|
@ -1662,6 +1695,11 @@ dnsiplookup(char *host, Ndbs *s, int v6)
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(mountdns() < 0){
|
||||||
|
qlock(&dblock);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
if(strcmp(ipattr(host), "ip") == 0)
|
if(strcmp(ipattr(host), "ip") == 0)
|
||||||
t = dnsquery(mntpt, host, "ptr");
|
t = dnsquery(mntpt, host, "ptr");
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -1364,6 +1364,8 @@ threadmain(int argc, char **argv)
|
||||||
sshfssrv.wstat = nil;
|
sshfssrv.wstat = nil;
|
||||||
sshfssrv.remove = nil;
|
sshfssrv.remove = nil;
|
||||||
}
|
}
|
||||||
|
if(mtpt == nil)
|
||||||
|
root = ".";
|
||||||
|
|
||||||
if(pflag){
|
if(pflag){
|
||||||
rdfd = 0;
|
rdfd = 0;
|
||||||
|
|
|
@ -30,7 +30,8 @@ struct Kfn{
|
||||||
void(*fn)(void);
|
void(*fn)(void);
|
||||||
Kfn *n;
|
Kfn *n;
|
||||||
};
|
};
|
||||||
Kfn kfn, kkn;
|
static Kfn kfn, kkn;
|
||||||
|
static int ax0, ax1;
|
||||||
|
|
||||||
void *
|
void *
|
||||||
emalloc(ulong sz)
|
emalloc(ulong sz)
|
||||||
|
@ -152,7 +153,10 @@ keyproc(void *)
|
||||||
k |= kp->k;
|
k |= kp->k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
k &= ~(k << 1 & 0xa0 | k >> 1 & 0x50);
|
if((k & ax0) == ax0)
|
||||||
|
k &= ~ax0;
|
||||||
|
if((k & ax1) == ax1)
|
||||||
|
k &= ~ax1;
|
||||||
keys = k;
|
keys = k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -291,6 +295,10 @@ regkey(char *joyk, Rune r, int k)
|
||||||
;
|
;
|
||||||
kp->n = emalloc(sizeof *kp);
|
kp->n = emalloc(sizeof *kp);
|
||||||
strncpy(kp->n->joyk, joyk, sizeof(kp->n->joyk)-1);
|
strncpy(kp->n->joyk, joyk, sizeof(kp->n->joyk)-1);
|
||||||
|
if(strcmp(joyk, "up") == 0 || strcmp(joyk, "down") == 0)
|
||||||
|
ax0 |= k;
|
||||||
|
if(strcmp(joyk, "left") == 0 || strcmp(joyk, "right") == 0)
|
||||||
|
ax1 |= k;
|
||||||
kp->n->r = r;
|
kp->n->r = r;
|
||||||
kp->n->k = k;
|
kp->n->k = k;
|
||||||
}
|
}
|
||||||
|
@ -310,7 +318,7 @@ initemu(int dx, int dy, int bpp, ulong chan, int dokey, void(*kproc)(void*))
|
||||||
if(dokey)
|
if(dokey)
|
||||||
proccreate(kproc != nil ? kproc : keyproc, nil, mainstacksize);
|
proccreate(kproc != nil ? kproc : keyproc, nil, mainstacksize);
|
||||||
if(kproc == nil)
|
if(kproc == nil)
|
||||||
proccreate(joyproc, nil, mainstacksize*2);
|
proccreate(joyproc, nil, mainstacksize);
|
||||||
bg = allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0xCCCCCCFF);
|
bg = allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0xCCCCCCFF);
|
||||||
screeninit();
|
screeninit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,13 +12,12 @@ static Ndbtuple *doquery(int, char *dn, char *type);
|
||||||
* search for a tuple that has the given 'attr=val' and also 'rattr=x'.
|
* search for a tuple that has the given 'attr=val' and also 'rattr=x'.
|
||||||
* copy 'x' into 'buf' and return the whole tuple.
|
* copy 'x' into 'buf' and return the whole tuple.
|
||||||
*
|
*
|
||||||
* return 0 if not found.
|
* return nil if not found.
|
||||||
*/
|
*/
|
||||||
Ndbtuple*
|
Ndbtuple*
|
||||||
dnsquery(char *net, char *val, char *type)
|
dnsquery(char *net, char *val, char *type)
|
||||||
{
|
{
|
||||||
char rip[128];
|
char buf[128];
|
||||||
char *p;
|
|
||||||
Ndbtuple *t;
|
Ndbtuple *t;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
@ -28,37 +27,18 @@ dnsquery(char *net, char *val, char *type)
|
||||||
|
|
||||||
if(net == nil)
|
if(net == nil)
|
||||||
net = "/net";
|
net = "/net";
|
||||||
snprint(rip, sizeof(rip), "%s/dns", net);
|
|
||||||
fd = open(rip, ORDWR);
|
snprint(buf, sizeof(buf), "%s/dns", net);
|
||||||
if(fd < 0){
|
if((fd = open(buf, ORDWR)) < 0)
|
||||||
if(strcmp(net, "/net") == 0)
|
return nil;
|
||||||
snprint(rip, sizeof(rip), "/srv/dns");
|
|
||||||
else {
|
|
||||||
snprint(rip, sizeof(rip), "/srv/dns%s", net);
|
|
||||||
p = strrchr(rip, '/');
|
|
||||||
*p = '_';
|
|
||||||
}
|
|
||||||
fd = open(rip, ORDWR);
|
|
||||||
if(fd < 0)
|
|
||||||
return nil;
|
|
||||||
if(mount(fd, -1, net, MBEFORE, "") < 0){
|
|
||||||
close(fd);
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
/* fd is now closed */
|
|
||||||
snprint(rip, sizeof(rip), "%s/dns", net);
|
|
||||||
fd = open(rip, ORDWR);
|
|
||||||
if(fd < 0)
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* zero out the error string */
|
/* zero out the error string */
|
||||||
werrstr("");
|
werrstr("");
|
||||||
|
|
||||||
/* if this is a reverse lookup, first lookup the domain name */
|
/* if this is a reverse lookup, first lookup the domain name */
|
||||||
if(strcmp(type, "ptr") == 0){
|
if(strcmp(type, "ptr") == 0){
|
||||||
mkptrname(val, rip, sizeof rip);
|
mkptrname(val, buf, sizeof buf);
|
||||||
t = doquery(fd, rip, "ptr");
|
t = doquery(fd, buf, "ptr");
|
||||||
} else
|
} else
|
||||||
t = doquery(fd, val, type);
|
t = doquery(fd, val, type);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue