/openwrt/scripts/ |
H A D | srecimage.pl | 19 my ($type, $addr, $data, $len) = @_; 23 $len = length($data) if ($len <= 0); 24 $len += 1 + (length($addrstr) / 2); 26 my $sum = $len; 34 $type, $len, $addrstr, uc(unpack('H*', $data)), ~($sum & 0xFF) & 0xFF; 46 my $len; 48 while (defined($len = read(IN, my $buf, 16)) && $len > 0) 50 print OUT srec(3, $off, $buf, $len); [all...] |
/openwrt/package/system/mtd/src/ |
H A D | crc32.h | 11 crc32(uint32_t val, const void *ss, int len) argument 14 while (--len >= 0) 19 static inline unsigned int crc32buf(char *buf, size_t len) argument 21 return crc32(0xFFFFFFFF, buf, len);
|
/openwrt/tools/include/ |
H A D | getline.h | 47 size_t len; local 51 buf = fgetln(fp, &len); 55 len = strlen(buf); 61 if (*outbuf == NULL || *outsize < len + 1) { 62 void *tmp = realloc(*outbuf, len + 1); 66 *outsize = len + 1; 68 memcpy(*outbuf, buf, len); 69 (*outbuf)[len] = '\0'; 70 return (len);
|
/openwrt/package/boot/rbcfg/src/ |
H A D | cyg_crc.h | 77 cyg_posix_crc32(unsigned char *s, int len); 82 cyg_crc32(unsigned char *s, int len); 88 cyg_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len); 93 cyg_ether_crc32(unsigned char *s, int len); 99 cyg_ether_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len); 104 cyg_crc16(unsigned char *s, int len);
|
/openwrt/tools/firmware-utils/src/ |
H A D | cyg_crc.h | 77 cyg_posix_crc32(unsigned char *s, int len); 82 cyg_crc32(unsigned char *s, int len); 88 cyg_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len); 93 cyg_ether_crc32(unsigned char *s, int len); 99 cyg_ether_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len); 104 cyg_crc16(unsigned char *s, int len);
|
H A D | mkbrnimg.c | 55 static uint32_t crc32buf(unsigned char *buf, size_t len) argument 59 for (; len; len--, buf++) 108 size_t len, padded_len; local 118 || (len = lseek(fd, 0, SEEK_END)) < 0 119 || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1) 137 crc = crc32buf(input_file, len); 141 write(outfd, input_file, len); 144 padded_len = ((len + sizeof(footer) + sizeof(padding) - 1) & ~(sizeof(padding) - 1)) - sizeof(footer); 145 fprintf(stderr, "len [all...] |
H A D | motorola-bin.c | 75 static uint32_t crc32buf(unsigned char *buf, size_t len) argument 79 for (; len; len--, buf++) 119 off_t len; // of original firmware local 132 || (len = lseek(fd, 0, SEEK_END)) < 0 133 || (trx = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1) 146 if (len < sizeof(struct motorola)) { 152 if (htonl(crc32buf(trx + offsetof(struct motorola, flags), len - offsetof(struct motorola, flags))) != firmware->crc) 173 || write(fd, trx + sizeof(struct motorola), len - sizeof(struct motorola)) != len [all...] |
H A D | add_header.c | 58 static uint32_t crc32buf(unsigned char *buf, size_t len) argument 62 for (; len; len--, buf++) 84 off_t len; // of original buf local 98 || (len = lseek(fd, 0, SEEK_END)) < 0 99 || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1) 106 buflen = len + sizeof(header); 117 memcpy(&buf[sizeof(header)], input_file, len); 135 munmap(input_file,len);
|
/openwrt/target/linux/adm5120/files-3.18/arch/mips/include/asm/mach-adm5120/prom/ |
H A D | admboot.h | 15 extern int admboot_get_mac_base(u32 offset, u32 len, u8 *mac) __init;
|
/openwrt/package/kernel/lantiq/ltq-ptm/src/ |
H A D | ifxmips_ptm_ar9.c | 349 int len = 0; local 351 len += sprintf(page + off + len, "EMA:\n"); 352 len += sprintf(page + off + len, " SB_MST_PRI0 - 0x%08X, SB_MST_PRI1 - 0x%08X\n", IFX_REG_R32(SB_MST_PRI0), IFX_REG_R32(SB_MST_PRI1)); 353 len += sprintf(page + off + len, " EMA_CMDCFG - 0x%08X, EMA_DATACFG - 0x%08X\n", IFX_REG_R32(EMA_CMDCFG), IFX_REG_R32(EMA_DATACFG)); 354 len += sprintf(page + off + len, " EMA_IER - 0x%08X, EMA_CFG - 0x%08X\n", IFX_REG_R32(EMA_IER), IFX_REG_R32(EMA_CFG)); 356 len [all...] |
H A D | ifxmips_ptm_test.c | 151 int len; local 157 len = sizeof(local_buf) < count ? sizeof(local_buf) - 1 : count; 158 len = len - copy_from_user(local_buf, buf, len); 159 local_buf[len] = 0; 163 while ( get_token(&p1, &p2, &len, &colon) ) 174 ignore_space(&p2, &len); 175 p = (unsigned long *)get_number(&p2, &len, 1); 181 ignore_space(&p2, &len); 280 int len = 0; local 337 int len, rlen; local 451 int len = 0; local 614 int len, rlen; local 818 get_token(char **p1, char **p2, int *len, int *colon) argument 862 get_number(char **p, int *len, int is_hex) argument 903 ignore_space(char **p, int *len) argument [all...] |
/openwrt/package/network/services/ead/src/ |
H A D | ead-crypt.h | 18 extern void ead_encrypt_message(struct ead_msg *msg, unsigned int len);
|
H A D | ead-crypt.c | 99 ead_hash_message(struct ead_msg_encrypted *enc, uint32_t *hash, int len) argument 106 while (len > 0) { 108 len -= 64; 114 ead_encrypt_message(struct ead_msg *msg, unsigned int len) argument 121 len += sizeof(struct ead_msg_encrypted); 122 enc->pad = (EAD_ENC_PAD - (len % EAD_ENC_PAD)) % EAD_ENC_PAD; 123 enclen = len + enc->pad; 124 msg->len = htonl(enclen); 130 DEBUG(2, "SHA1 generate (0x%08x), len=%d\n", enc->hash[0], enclen); 145 int len local [all...] |
H A D | ead-client.c | 83 int len; local 89 sendto(s, msgbuf, sizeof(struct ead_msg) + ntohl(msg->len), 0, (struct sockaddr *) &remote, sizeof(remote)); 106 len = read(s, msgbuf, sizeof(msgbuf)); 107 if (len < 0) 110 if (len < sizeof(struct ead_msg)) 113 if (len < sizeof(struct ead_msg) + ntohl(msg->len)) 152 int len = ntohl(msg->len) - sizeof(struct ead_msg_pong); local 154 if (len < 192 int len = ntohl(msg->len) - sizeof(struct ead_msg_number); local [all...] |
/openwrt/target/linux/x86/image/ |
H A D | mkimg_bifferboard.py | 26 if len(sys.argv) != 4: 36 if len(fw) > (kernel_extent - config_extent): 40 while len(fw) < (kernel_extent - config_extent): 46 if len(fw) > (flash_size - 0x10000 - config_extent):
|
/openwrt/package/network/services/ead/src/tinysrp/ |
H A D | t_client.c | 62 if(n->len < MIN_MOD_BYTES) 66 if(tpc->modulus.len == n->len && tpc->generator.len == g->len && 67 memcmp(tpc->modulus.data, n->data, n->len) == 0 && 68 memcmp(tpc->generator.data, g->data, g->len) == 0) { 84 tc->n.len = n->len; 86 memcpy(tc->n.data, n->data, tc->n.len); [all...] |
H A D | t_server.c | 63 ts->n.len = tce->modulus.len; 65 memcpy(ts->n.data, tce->modulus.data, ts->n.len); 68 SHA1Update(&ctxt, ts->n.data, ts->n.len); 71 ts->g.len = tce->generator.len; 73 memcpy(ts->g.data, tce->generator.data, ts->g.len); 76 SHA1Update(&ctxt, ts->g.data, ts->g.len); 90 ts->v.len = ent->password.len; [all...] |
H A D | tinysrp.c | 59 salt.len = msgbuf[1]; 60 if (salt.len > MAXSALTLEN) { 64 i = recv(s, sbuf, salt.len, MSG_WAITALL); 79 msgbuf[0] = A->len - 1; /* len is max 256 */ 80 memcpy(msgbuf + 1, A->data, A->len); 81 if (send(s, msgbuf, A->len + 1, 0) < 0) { 99 B.len = msgbuf[0] + 1; 101 i = recv(s, bbuf, B.len, MSG_WAITALL); 171 i = ts->s.len; [all...] |
/openwrt/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ |
H A D | ag71xx_debugfs.c | 48 len += snprintf(buf + len, sizeof(buf) - len, \ 53 unsigned int len = 0; local 61 len += snprintf(buf + len, sizeof(buf) - len, "\n"); 64 return simple_read_from_buffer(user_buf, count, ppos, buf, len); 104 unsigned int len = 0; local 121 len 164 unsigned int len = 0; local [all...] |
/openwrt/target/linux/adm5120/files-3.18/drivers/leds/ |
H A D | ledtrig-adm5120-switch.c | 56 int len = 0; local 62 len += sprintf(buf+len, "[%s] ", port_states[i].name); 64 len += sprintf(buf+len, "%s ", port_states[i].name); 66 len += sprintf(buf+len, "\n"); 68 return len; 75 size_t len; local 79 len [all...] |
/openwrt/target/linux/ar71xx/files/arch/mips/ath79/ |
H A D | nvram.c | 21 unsigned len = strlen(name); local 24 if (buf_len == 0 || len == 0) 27 if (buf_len < len) 30 if (len == 1) 33 last = (char *) buf + buf_len - len; 35 if (cur[0] == name[0] && memcmp(cur, name, len) == 0) 36 return cur + len;
|
/openwrt/target/linux/adm5120/files-3.18/arch/mips/adm5120/prom/ |
H A D | routerboot.c | 31 u16 id, len; local 52 len = prom_read_le16(buf); 56 if (buflen < len) 73 if ((len / RB_MAC_SIZE) > 0) 78 buf += len; 79 buflen -= len; 93 u32 off, len; local 102 len = prom_read_le32(&bs->hs_size); 106 if (routerboot_load_hs(base+off, len) != 0)
|
/openwrt/package/utils/px5g/ |
H A D | px5g.c | 44 static int _urandom(void *ctx, unsigned char *out, size_t len) argument 46 read(urandom_fd, out, len); 50 static void write_file(const char *path, int len, bool pem) argument 56 buf_start += sizeof(buf) - len; 58 if (!len) { 71 fwrite(buf_start, 1, len, f); 77 int len = 0; local 81 len = strlen(buf); 83 len = pk_write_key_der(key, (void *) buf, sizeof(buf)); 84 if (len < 147 int len; local [all...] |
/openwrt/tools/patch-image/src/ |
H A D | patch-dtb.c | 37 int fd, fddtb, found = 0, len, ret = -1; local 61 len = s.st_size; 62 if (len + 8 > dtb_max_size) { 92 memcpy(p, ptrdtb, len); 93 msync(p, len, MS_SYNC|MS_INVALIDATE); 97 munmap((void *) ptr, len); 101 munmap((void *) ptrdtb, len);
|
/openwrt/target/linux/generic/files/drivers/net/phy/ |
H A D | rtl8366_smi.c | 96 static void rtl8366_smi_write_bits(struct rtl8366_smi *smi, u32 data, u32 len) argument 101 for (; len > 0; len--) { 105 gpio_set_value(sda, !!(data & ( 1 << (len - 1)))); 115 static void rtl8366_smi_read_bits(struct rtl8366_smi *smi, u32 len, u32 *data) argument 122 for (*data = 0; len > 0; len--) { 133 *data |= (u << (len - 1)); 614 int i, len = 0; local 617 len 643 int i, len = 0; local 678 int len = 0; local 706 int err, len = 0; local 732 size_t len; local 765 int i, j, len = 0; local 999 int i, len = 0; local 1033 u32 len = 0; local [all...] |